Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of elements not relevant to the currently active telemetry kind #58

Closed
tsteckenborn opened this issue Jan 11, 2024 · 1 comment · Fixed by #55
Closed

Validation of elements not relevant to the currently active telemetry kind #58

tsteckenborn opened this issue Jan 11, 2024 · 1 comment · Fixed by #55

Comments

@tsteckenborn
Copy link

Hey there,

Given the usage of the ConsoleSpanExporter it seems that other validations not relevant to this kind are performed.

So assuming that "kind": "to-dynatrace" is configured for production (or not configured at all) if there's a default env file containing dynatrace credentials at all, the plugin fails the start as:

[cds] - loading plugin @cap-js/telemetry: { impl: 'node_modules/@cap-js/telemetry/cds-plugin.js' }
[telemetry] - @opentelemetry/api: Registered a global for diag v1.6.0.
[telemetry] - @opentelemetry/api: Registered a global for trace v1.6.0.
[telemetry] - @opentelemetry/api: Registered a global for context v1.6.0.
[telemetry] - @opentelemetry/api: Registered a global for propagation v1.6.0.
[telemetry] - Using tracing exporter: ConsoleSpanExporter { _temporaryStorage: Map(0) {} }
[telemetry] - @opentelemetry/instrumentation-http Applying patch for http@20.10.0
[telemetry] - @opentelemetry/instrumentation-http Applying patch for https@20.10.0

leading to:

Error: Neither metrics_apitoken nor rest_apitoken.token found in Dynatrace credentials
    at _getExporter (/.../Documents/ServiceRequests/node_modules/@cap-js/telemetry/lib/metrics/index.js:27:23)
    at module.exports (/.../Documents/ServiceRequests/node_modules/@cap-js/telemetry/lib/metrics/index.js:44:20)
    at module.exports (/.../Documents/ServiceRequests/node_modules/@cap-js/telemetry/lib/index.js:27:3)
    at Object.<anonymous> (/.../Documents/ServiceRequests/node_modules/@cap-js/telemetry/cds-plugin.js:1:48)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Object.require.extensions.<computed> [as .js] (/usr/local/lib/node_modules/ts-node/src/index.ts:1608:43)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)

I'd understand this behaviour if it's instructed to export to dynatrace, yet not if the console export is supposed to be used.

@sjvans
Copy link
Contributor

sjvans commented Jan 15, 2024

thanks @tsteckenborn, will be in 0.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants