Skip to content

Commit

Permalink
chore: update to new version (#212)
Browse files Browse the repository at this point in the history
* chore: update to new version

* fix: doc and deprecated attribute
  • Loading branch information
jufab authored Sep 18, 2024
1 parent f57c6ca commit 5b9fb3b
Show file tree
Hide file tree
Showing 8 changed files with 3,059 additions and 2,316 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ opentelemetryConfig: {
logBody: true, //(boolean) true add body in a log, nothing otherwise
serviceName: 'interceptor-example', //Service name send in trace
resourceAttributes: { // extra resource attributes like service.namespace
[SemanticResourceAttributes.SERVICE_NAMESPACE]: 'namespace'
[ATTR_SERVICE_NAMESPACE]: 'namespace'
},
probabilitySampler: '0.7', //Samples a configurable percentage of traces, string value between '0' to '1'
logLevel:DiagLogLevel.ALL //(Enum) DiagLogLevel is an Enum from @opentelemetry/api
Expand Down
2 changes: 1 addition & 1 deletion collector/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
ports:
- "9411:9411"
otel-collector:
image: otel/opentelemetry-collector-contrib:0.100.0
image: otel/opentelemetry-collector-contrib:0.109.0
networks:
- otelcol
command: ["--config=/etc/otel-collector-config.yaml"]
Expand Down
5,299 changes: 3,021 additions & 2,278 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,36 @@
"@angular/cli": "^14.2.12",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@compodoc/compodoc": "^1.1.23",
"@opentelemetry/api": "1.8.0",
"@opentelemetry/context-zone-peer-dep": "1.24.1",
"@opentelemetry/exporter-trace-otlp-http": "0.51.1",
"@opentelemetry/exporter-zipkin": "1.24.1",
"@opentelemetry/instrumentation": "0.51.1",
"@opentelemetry/instrumentation-xml-http-request": "0.51.1",
"@opentelemetry/propagator-aws-xray": "1.24.1",
"@opentelemetry/propagator-b3": "1.24.1",
"@opentelemetry/propagator-jaeger": "1.24.1",
"@opentelemetry/sdk-trace-web": "1.24.1",
"@compodoc/compodoc": "^1.1.25",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/context-zone-peer-dep": "1.26.0",
"@opentelemetry/exporter-trace-otlp-http": "0.53.0",
"@opentelemetry/exporter-zipkin": "1.26.0",
"@opentelemetry/instrumentation": "0.53.0",
"@opentelemetry/instrumentation-xml-http-request": "0.53.0",
"@opentelemetry/propagator-aws-xray": "1.26.0",
"@opentelemetry/propagator-b3": "1.26.0",
"@opentelemetry/propagator-jaeger": "1.26.0",
"@opentelemetry/sdk-trace-web": "1.26.0",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.11",
"@types/jest": "^29.5.13",
"@types/node": "^16.15.0",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"concurrently": "^8.2.2",
"cypress": "^13.6.3",
"concurrently": "^9.0.1",
"cypress": "^13.14.2",
"eslint": "^8.56.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "^46.8.1",
"eslint-plugin-import": "2.30.0",
"eslint-plugin-jsdoc": "^50.2.3",
"eslint-plugin-prefer-arrow": "1.2.3",
"express": "^4.19.2",
"express": "^4.21.0",
"jest": "^29.7.0",
"jest-html-reporters": "^3.1.7",
"jest-junit": "^16.0.0",
"jest-preset-angular": "^13.1.6",
"ng-packagr": "^14.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.1.1",
"ts-jest": "^29.2.5",
"ts-node": "~10.9.2",
"typescript": "~4.6.4"
}
Expand Down
4 changes: 2 additions & 2 deletions projects/interceptor-example/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { INGXLoggerConfig, NgxLoggerLevel } from 'ngx-logger';
import { DiagLogLevel } from '@opentelemetry/api';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { ATTR_SERVICE_NAMESPACE } from '@opentelemetry/semantic-conventions/incubating';
import {
OpenTelemetryConfig
} from '../../../opentelemetry-interceptor/src/public-api';
Expand All @@ -22,7 +22,7 @@ export const environment: IEnvironment = {
production: true, // Send Trace with BatchSpanProcessor (true) or SimpleSpanProcessor (false)
serviceName: 'interceptor-example', // Service name send in trace
resourceAttributes: { // extra resource attributes like service.namespace
[SemanticResourceAttributes.SERVICE_NAMESPACE]: 'namespace'
[ATTR_SERVICE_NAMESPACE]: 'namespace'
},
logBody: true, // true add body in a log, nothing otherwise
probabilitySampler: '1', // 75% sampling
Expand Down
18 changes: 9 additions & 9 deletions projects/opentelemetry-interceptor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"peerDependencies": {
"@angular/common": ">=14.0.0",
"@angular/core": ">=14.0.0",
"@opentelemetry/api": "1.8.0",
"@opentelemetry/context-zone-peer-dep": "1.24.1",
"@opentelemetry/exporter-trace-otlp-http": "0.51.1",
"@opentelemetry/exporter-zipkin": "1.24.1",
"@opentelemetry/instrumentation": "0.51.1",
"@opentelemetry/propagator-aws-xray": "1.24.1",
"@opentelemetry/propagator-b3": "1.24.1",
"@opentelemetry/propagator-jaeger": "1.24.1",
"@opentelemetry/sdk-trace-web": "1.24.1"
"@opentelemetry/api": "1.9.0",
"@opentelemetry/context-zone-peer-dep": "1.26.0",
"@opentelemetry/exporter-trace-otlp-http": "0.53.0",
"@opentelemetry/exporter-zipkin": "1.26.0",
"@opentelemetry/instrumentation": "0.53.0",
"@opentelemetry/propagator-aws-xray": "1.26.0",
"@opentelemetry/propagator-b3": "1.26.0",
"@opentelemetry/propagator-jaeger": "1.26.0",
"@opentelemetry/sdk-trace-web": "1.26.0"
},
"dependencies": {
"tslib": "^2.6.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ClassProvider, ConstructorProvider, ExistingProvider, FactoryProvider, InjectionToken, ValueProvider } from '@angular/core';
import { AttributeValue, DiagLogger, DiagLogLevel } from '@opentelemetry/api';
import { InstrumentationOption } from '@opentelemetry/instrumentation';
import { Instrumentation } from '@opentelemetry/instrumentation';
import { CustomSpan } from '../interceptor/custom-span.interface';

/**
Expand Down Expand Up @@ -138,7 +138,7 @@ export const OTEL_LOGGER = new InjectionToken<DiagLogger>('otelcol.logger');
/** custom span */
export const OTEL_CUSTOM_SPAN = new InjectionToken<CustomSpan>('otelcol.custom-span');

export const OTEL_INSTRUMENTATION_PLUGINS = new InjectionToken<InstrumentationOption[]>('otelcol.instrumentation.plugins');
export const OTEL_INSTRUMENTATION_PLUGINS = new InjectionToken<Instrumentation[]>('otelcol.instrumentation.plugins');

export const defineConfigProvider = (
config: OpenTelemetryConfig | null | undefined,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Inject, Injectable } from '@angular/core';
import { ZoneContextManager } from '@opentelemetry/context-zone-peer-dep';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';
import { Resource } from '@opentelemetry/resources';
import { InstrumentationOption, registerInstrumentations } from '@opentelemetry/instrumentation';
import { Instrumentation, registerInstrumentations } from '@opentelemetry/instrumentation';
import {
AlwaysOffSampler,
AlwaysOnSampler,
Expand Down Expand Up @@ -50,7 +50,7 @@ export class InstrumentationService {
@Inject(OTEL_PROPAGATOR)
private propagatorService: IPropagator,
@Inject(OTEL_INSTRUMENTATION_PLUGINS)
private instrumentationOptions: InstrumentationOption[]) {
private instrumentation: Instrumentation[]) {
this.tracerProvider = new WebTracerProvider({
sampler: this.defineProbabilitySampler(this.convertStringToNumber(this.config.commonConfig.probabilitySampler)),
resource: this.loadResourceAttributes(this.config.commonConfig),
Expand All @@ -69,7 +69,7 @@ export class InstrumentationService {
});

registerInstrumentations({
instrumentations: this.instrumentationOptions,
instrumentations: this.instrumentation,
tracerProvider: this.tracerProvider,
});
}
Expand All @@ -80,7 +80,7 @@ export class InstrumentationService {
private loadResourceAttributes(commonConfig: CommonCollectorConfig): Resource {
let resourceAttributes = Resource.default().merge(
new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: commonConfig.serviceName,
[ATTR_SERVICE_NAME]: commonConfig.serviceName,
})
);
if (commonConfig.resourceAttributes !== undefined) {
Expand Down

0 comments on commit 5b9fb3b

Please sign in to comment.