Skip to content

Commit a5d6486

Browse files
Adjust opentelemetry events for better visibility (#125)
1 parent 749a027 commit a5d6486

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/app/app.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ import { AssetsService } from './core/services/assets.service';
2323
export const appConfig: ApplicationConfig = {
2424
providers: [
2525
provideRouter(
26-
routes,
26+
[
27+
{
28+
path: '',
29+
title: 'Backbase Engineering',
30+
children: routes
31+
}
32+
],
2733
withInMemoryScrolling({
2834
scrollPositionRestoration: 'enabled',
2935
anchorScrolling: 'enabled',

src/app/core/services/observability.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class ObservabilityService {
6969

7070
provider.getActiveSpanProcessor().onStart = (span: Span) => {
7171
span.setAttribute('view.name', document.title);
72-
span.setAttribute('view.path', document.location.href);
72+
span.setAttribute('http.url', document.location.href);
7373
};
7474

7575
registerInstrumentations({

src/app/features/post/post.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { MatButtonModule } from '@angular/material/button';
3737
import { MatSidenavModule } from '@angular/material/sidenav';
3838
import { NotFoundComponent } from '../not-found/not-found.component';
3939
import { HtmlInMarkdownService } from '../../core/services/html-in-markdown.service';
40-
import { Meta } from '@angular/platform-browser';
40+
import { Meta, Title } from '@angular/platform-browser';
4141
import { ObservabilityService } from '../../core/services/observability.service';
4242

4343
@Component({
@@ -81,6 +81,9 @@ export class PostComponent implements OnDestroy {
8181
});
8282
return;
8383
}),
84+
tap((post) =>
85+
this.title.setTitle(`${post.title} | ${this.activatedRoute.snapshot.parent?.title}`)
86+
),
8487
tap((posts) => this.setRelatedPosts(posts)),
8588
tap((posts) => this.observability.publishEvent({
8689
post: posts.title,
@@ -116,7 +119,8 @@ export class PostComponent implements OnDestroy {
116119
@Inject(DOCUMENT) private document: Document,
117120
private htmlInMarkdownService: HtmlInMarkdownService,
118121
private meta: Meta,
119-
private observability: ObservabilityService
122+
private observability: ObservabilityService,
123+
private title: Title,
120124
) {}
121125

122126
ngOnDestroy(): void {

0 commit comments

Comments
 (0)