Skip to content

Commit

Permalink
[frontend] use frontend-web for web client service name (#628)
Browse files Browse the repository at this point in the history
* use frontend-web for web client service name

Signed-off-by: Pierre Tessier <[email protected]>

* use frontend-web for web client service name

Signed-off-by: Pierre Tessier <[email protected]>

Signed-off-by: Pierre Tessier <[email protected]>
Co-authored-by: Austin Parker <[email protected]>
  • Loading branch information
puckpuck and austinlparker authored Dec 12, 2022
1 parent 93b0fa3 commit a5668ad
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#613](https://github.com/open-telemetry/opentelemetry-demo/pull/613))
* Build Kafka image
([#617](https://github.com/open-telemetry/opentelemetry-demo/pull/617))
* Use `frontend-web` as service name for browser/web requests
([#628](https://github.com/open-telemetry/opentelemetry-demo/pull/628))
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ services:
- ENV_PLATFORM
- OTEL_SERVICE_NAME=frontend
- PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
- WEB_OTEL_SERVICE_NAME=frontend-web
depends_on:
- adservice
- cartservice
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Document, { DocumentContext, Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheet } from 'styled-components';

const { ENV_PLATFORM, OTEL_SERVICE_NAME, PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT } = process.env;
const { ENV_PLATFORM, WEB_OTEL_SERVICE_NAME, PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT } = process.env;

const envString = `
window.ENV = {
NEXT_PUBLIC_PLATFORM: '${ENV_PLATFORM}',
NEXT_PUBLIC_OTEL_SERVICE_NAME: '${OTEL_SERVICE_NAME}',
NEXT_PUBLIC_OTEL_SERVICE_NAME: '${WEB_OTEL_SERVICE_NAME}',
NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '${PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT}',
};
`;
Expand Down

0 comments on commit a5668ad

Please sign in to comment.