Skip to content

Commit

Permalink
feat: integrate bb opentelemetry observability connector (#222)
Browse files Browse the repository at this point in the history
* chore: test otel connector

* chore: update otel init

* chore: update otel config

* chore: add env for otel

* chore: fix path for package.json

* fix: package.json import issue

* chore: bump ui-ang version
  • Loading branch information
ankypant authored Sep 21, 2023
1 parent 94c8d2f commit ab41cfd
Show file tree
Hide file tree
Showing 8 changed files with 654 additions and 27 deletions.
10 changes: 10 additions & 0 deletions apps/golden-sample-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { LocaleSelectorModule } from './locale-selector/locale-selector.module';
import { TrackerModule } from '@backbase/foundation-ang/observability';
import { UserContextInterceptor } from './user-context/user-context.interceptor';
import { ActivityMonitorModule } from './auth/activity-monitor';
import packageInfo from 'package-json';

@NgModule({
declarations: [AppComponent],
Expand All @@ -70,6 +71,15 @@ import { ActivityMonitorModule } from './auth/activity-monitor';
TransactionSigningModule,
TrackerModule.forRoot({
handler: AnalyticsService,
openTelemetryConfig: {
appName: packageInfo.name,
appVersion: packageInfo.version,
apiKey: environment.bbApiKey,
env: 'local',
isProduction: environment.production,
isEnabled: environment.isTelemetryTracerEnabled,
url: environment.telemetryCollectorURL,
},
}),
ActivityMonitorModule,
],
Expand Down
6 changes: 1 addition & 5 deletions apps/golden-sample-app/src/app/services/analytics.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { TrackerHandler } from '@backbase/foundation-ang/observability';

/*
/*
This service will receive all the analytics events from your application and from here you can
send all your tracker events to the analytics system (eg: google analytics/segment stc)
*/
Expand All @@ -11,9 +11,5 @@ export class AnalyticsService extends TrackerHandler {
this.tracker.subscribeAll((event) => {
console.log('EVENT TRACKER', event);
});

// this.tracker.subscribe(ScreenResizeEvent, event => {
// console.log(event);
// });
}
}
4 changes: 4 additions & 0 deletions apps/golden-sample-app/src/environments/environment.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export const environment: Environment = {
designSlimMode: false,
},
mockEnabled: true,
isTelemetryTracerEnabled: true,
bbApiKey: '27d4d4ee-afc1-4190-adc4-b9d30d39badb',
telemetryCollectorURL: 'https://botel.bartbase.com/v1/traces',
env: 'mock',
};

export const authConfig: AuthConfig = {
Expand Down
4 changes: 4 additions & 0 deletions apps/golden-sample-app/src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const environment: Environment = {
common: {
designSlimMode: false,
},
isTelemetryTracerEnabled: true,
bbApiKey: '27d4d4ee-afc1-4190-adc4-b9d30d39badb',
telemetryCollectorURL: 'https://botel.bartbase.com/v1/traces',
env: 'local',
};

export const authConfig: AuthConfig = {
Expand Down
4 changes: 4 additions & 0 deletions apps/golden-sample-app/src/environments/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ export interface Environment {
mockProviders?: Provider[];
mockEnabled?: boolean;
common: sharedJourneyConfiguration;
isTelemetryTracerEnabled?: boolean;
bbApiKey?: string;
telemetryCollectorURL?: string;
env?: string;
}
Loading

0 comments on commit ab41cfd

Please sign in to comment.