Skip to content

Commit

Permalink
Add Resource Detectors to frontend service (#648)
Browse files Browse the repository at this point in the history
* Add Resource Detectors to frontend service

Signed-off-by: svrnm <neumanns@cisco.com>

* Update documentation, fixing style

Signed-off-by: svrnm <neumanns@cisco.com>

* Add PR no and link to CHANGELOG

Signed-off-by: svrnm <neumanns@cisco.com>

* Update src/frontend/package.json

Co-authored-by: Michael Maxwell <mike.ian.maxwell@gmail.com>

Signed-off-by: svrnm <neumanns@cisco.com>
Co-authored-by: Juliano Costa <julianocosta89@outlook.com>
Co-authored-by: Michael Maxwell <mike.ian.maxwell@gmail.com>
Co-authored-by: Pierre Tessier <pierre@pierretessier.com>
  • Loading branch information
4 people authored Dec 24, 2022
1 parent 36edc26 commit 36d9fff
Show file tree
Hide file tree
Showing 5 changed files with 356 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ significant modifications will be credited to OpenTelemetry Authors.
([#628](https://github.com/open-telemetry/opentelemetry-demo/pull/628))
* Update `quoteservice` to use opentelemetry-php beta release
([#644](https://github.com/open-telemetry/opentelemetry-demo/pull/644))
* Add resource detectors to frontend service
([#648](https://github.com/open-telemetry/opentelemetry-demo/pull/648))
20 changes: 18 additions & 2 deletions docs/services/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@ for OTLP export, resource attributes, and service name.
```javascript
const opentelemetry = require("@opentelemetry/sdk-node")
const { getNodeAutoInstrumentations } = require("@opentelemetry/auto-instrumentations-node")
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-grpc')
const { alibabaCloudEcsDetector } = require('@opentelemetry/resource-detector-alibaba-cloud')
const { awsEc2Detector, awsEksDetector } = require('@opentelemetry/resource-detector-aws')
const { containerDetector } = require('@opentelemetry/resource-detector-container')
const { gcpDetector } = require('@opentelemetry/resource-detector-gcp')
const { envDetector, hostDetector, osDetector, processDetector } = require('@opentelemetry/resources')

const sdk = new opentelemetry.NodeSDK({
traceExporter: new OTLPTraceExporter(),
instrumentations: [ getNodeAutoInstrumentations() ]
instrumentations: [ getNodeAutoInstrumentations() ],
resourceDetectors: [
containerDetector,
envDetector,
hostDetector,
osDetector,
processDetector,
alibabaCloudEcsDetector,
awsEksDetector,
awsEc2Detector,
gcpDetector
]
})

sdk.start()
Expand Down
Loading

0 comments on commit 36d9fff

Please sign in to comment.