Compare commits

...

1502 Commits

Author SHA1 Message Date
Svetlana Brennan 48538b46ad
chore(sdk-logs): refactored imports (#5801) 2025-07-23 15:32:40 +00:00
Hector Hernandez 8de88737ff
Fix broken relative paths (#5806) 2025-07-22 14:49:07 +00:00
Kurt King d63dfaef09
fix: broken sdk-metrics and auto-instrumentations-node links in node-sdk README (#5796)
Signed-off-by: Kurt King <kurtaking@gmail.com>
2025-07-18 20:15:16 +00:00
rads-1996 cb42f7d511
Added logic for Url redaction (#5743) 2025-07-14 20:07:17 +00:00
OpenTelemetry Bot 99dde7786f
chore: prepare next release (#5795) 2025-07-10 21:00:31 +00:00
Trent Mick 287d46353d
docs(semantic-conventions): correct placement of semconv 1.36.0 changes in changelog (#5794) 2025-07-10 20:43:00 +00:00
OpenTelemetry Bot 8e1fc80d1a
chore: prepare next release (#5793) 2025-07-10 19:04:30 +00:00
OpenTelemetry Bot 1537d405fe
chore: prepare next release (#5793) 2025-07-10 19:04:30 +00:00
Trent Mick 06330cebbb
feat(semantic-conventions): update semantic conventions to v1.36.0 (#5779) 2025-07-10 18:35:35 +00:00
Trent Mick 41ba7f57cb
feat(semantic-conventions): improve the jsdoc comment on exported constants for enum values (#5784) 2025-07-10 08:01:07 +00:00
OpenTelemetry Bot a0618ad0c7
Sort contributor listings and remove affiliation from emeriti (#5790)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-07-10 08:00:37 +00:00
Trask Stalnaker 2c7037662c
Ensure correct CodeQL workflow permissions (#5791)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-07-10 07:46:15 +00:00
OpenTelemetry Bot 93187f0224
chore: prepare next release (#5788) 2025-07-09 13:18:02 +00:00
Marc Pichler ca6ae61783
chore: sync package-lock.json (#5782) 2025-07-09 12:36:56 +00:00
Marc Pichler 407c98a09f
refactor(otlp-exporter-base): remove pre-Node.js 14 compatibility code (#5787) 2025-07-09 12:36:21 +00:00
Marc Pichler 27d5171890
ci: add write permissions for secuity events (#5786) 2025-07-09 11:47:52 +00:00
OpenTelemetry Bot 7a32f86055
Add minimum token permissions for all github workflow files (#5771)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-07-08 09:34:26 +00:00
sceee 5c4057bb8d
fix(docs): fix minimum ECMAScript language support in Readme to ES2022 (#5774)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-07-07 08:45:46 +00:00
Godfrey Chan 553db87117
refactor(sdk-node): fix eslint warning (#5400)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-07-04 17:04:20 +00:00
Marc Pichler 74d434eecd
ci: remove unused label-releases workflow (#5772) 2025-07-02 07:29:26 +00:00
Trask Stalnaker a59d707c42
Standardize contributing section (#5767) 2025-06-30 07:42:12 +00:00
Svetlana Brennan 491ed96aca
feat(sdk-logs)!: Removed deprecated `LoggerProvider#addLogRecordProcessor()` (#5764) 2025-06-30 07:41:53 +00:00
OpenTelemetry Bot e18a6c8456
Fix outdated community membership link (#5766)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-06-27 08:43:04 +00:00
Trent Mick 8505a6147e
fix(sdk-metrics): remove invalid default value for 'startTime' param to ExponentialHistogramAccumulation (#5763) 2025-06-25 17:02:01 +00:00
OpenTelemetry Bot 04a8150d37
Update community member listings (#5761)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-06-25 07:55:00 +00:00
Svetlana Brennan ec17ce48d0
feat(sdk-logs)!: Changed `LogRecord` to be an interface (#5749)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-06-17 18:37:57 +00:00
Siim Kallas f2cfd1327a
feat(api): improve isValidSpanId, isValidTraceId performance (#5714)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-06-13 12:48:31 +00:00
Zirak 62fbfd3d0d
docs(exporter-logs-otlp-proto): Fixup markdown table (#5740)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Raphaël Thériault <113933910+raphael-theriault-swi@users.noreply.github.com>
2025-06-13 08:14:51 +00:00
OpenTelemetry Bot 995d708729
Use more specific self-hosted runner name (#5747)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2025-06-12 02:21:16 +00:00
Svetlana Brennan 86bab66f32
refactor!: Removed `api-events` and `sdk-events` (#5737) 2025-06-11 21:54:58 +00:00
Svetlana Brennan 5b3c6b4e83
chore: Regenerated certs (#5752) 2025-06-11 21:10:53 +00:00
Marc Pichler a4e9645829
deps: update to sinon@18.0.1 (#5742) 2025-06-06 14:47:18 +00:00
yoshi-taka 7e30af4c15
fix typo (#5745)
Co-authored-by: Marylia Gutierrez <maryliag@gmail.com>
2025-06-05 16:07:23 +00:00
Logan Rosen 3578f68c74
chore: upgrade to typescript-eslint v8 (#5478)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-06-04 09:45:10 +00:00
Daniel Dyla 56df3c0346
feat: add event name to event API and SDK (#5707)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2025-06-02 17:37:06 +00:00
OpenTelemetry Bot 55f8c20b19
chore: prepare next release (#5713) 2025-06-02 14:54:37 +00:00
Marc Pichler c04536857e
chore: move @naseemkullah to emeritus (#5708) 2025-06-02 14:54:11 +00:00
Daniel Dyla b1dc46473c
Improve e2e stability (#5715) 2025-06-02 12:31:39 +00:00
Trent Mick 22bc5bac9b
docs: fix typo in 'http/dup' value to use with OTEL_SEMCONV_STABILITY_OPT_IN envvar (#5725) 2025-05-30 23:14:55 +00:00
Daniel Dyla 5736c49842
feat: update proto to 1.7.0 (#5643)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2025-05-28 15:01:55 +00:00
Colin Ihrig c1935022c1
fix(instrumentation): remove dependency on the shimmer module (#5652) 2025-05-28 10:38:03 +00:00
YangJH 4919fd1711
feat(exporter-metrics-otlp-proto): Support to protobuf in browser metrics (#5710) 2025-05-27 08:59:33 +00:00
Marc Pichler a9fc600f2b
chore(deps): update to msw@2.8.4 (#5709) 2025-05-23 17:53:44 +00:00
renovate[bot] 08afa47f6a
chore(deps): update dependency webpack to v5.99.9 (#5704)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-22 15:10:01 +00:00
OpenTelemetry Bot a2e0f2c6ac
chore: prepare next release (#5705) 2025-05-21 20:20:17 +00:00
Trent Mick 019cb2c149
feat(semantic-conventions): update semantic conventions to v1.34.0 (#5703) 2025-05-21 17:41:15 +00:00
Chengzhong Wu 7a9b04904c
chore: enable tsconfig isolatedModules (#5697) 2025-05-21 08:10:51 +00:00
OpenTelemetry Bot 6d0d33b3df
chore: prepare next release (#5700) 2025-05-20 21:31:59 +00:00
Trent Mick 280cd5012b
test(instrumentation-fetch): pin msw dep to avoid breakage in msw@2.8 (#5702) 2025-05-20 20:59:09 +00:00
Trent Mick 1c8ec3b291
fix(semantic-conventions): Remove the subset of `DB_SYSTEM_NAME_VALUE_*` exports that are unstable from the `@opentelemetry/semantic-conventions` entry point. (#5690) 2025-05-20 15:59:50 +00:00
Łukasz Jernaś 85f1bcc256
chore(opentelemetry-instrumentation-http): Fix link to docs (#5699)
Signed-off-by: Łukasz Jernaś <lukasz.jernas@allegro.com>
2025-05-20 14:52:06 +00:00
renovate[bot] f0ba942c04
chore(deps): update dependency @babel/core to v7.27.1 (#5698)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-20 07:29:26 +00:00
renovate[bot] af9c024c04
chore(deps): update all patch versions (#5694)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 16:49:18 +00:00
OpenTelemetry Bot 9dbd1e446b
chore: prepare next release (#5696) 2025-05-19 09:14:41 +00:00
Trent Mick 4e2703c3e0
fix(instrumentation): change `SemconvStability` export from `const enum` to `enum` (#5692) 2025-05-16 21:00:10 +00:00
Trent Mick 072d8a8b2b
refactor(semantic-conventions): use weaver 'file_name' template config (#5689) 2025-05-15 21:39:24 +00:00
Trent Mick 04545fa4ab
refactor(semantic-conventions): tweak the leading spacing of comments on enum values (#5688) 2025-05-15 18:34:37 +00:00
Trent Mick baec0a3e65
refactor(semantic-conventions): weaver 0.13.0 supports a 'stable_only' arg to semconv_attributes (#5687) 2025-05-15 18:12:12 +00:00
Marc Pichler 4ce5bd1651
chore: prepare release 2.0.1/0.201.0 (#5683) 2025-05-15 17:59:44 +00:00
renovate[bot] 6803723f69
fix(deps): update all patch versions (#5685)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-15 12:33:08 +00:00
Trent Mick d4d373217a
feat(instrumentation): export generic 'semconvStabilityFromStr()' utility, rather than namespace-specific ones (#5684) 2025-05-14 23:30:07 +00:00
Colin Ihrig 56610a0c6f
test: test Node.js 24 in CI (#5661)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2025-05-14 13:47:42 +00:00
Jamie Danielson 697e1d31bd
refactor(instrumentation-http): Add back support for http semconv (#5665)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-05-12 20:18:25 +00:00
Marc Pichler 373edd9bc1
Revert "fix(sdk-metrics): improve PeriodicExportingMetricReader() constructor input validation (#5621)" (#5671) 2025-05-12 14:14:27 +00:00
Trent Mick 0c21db4621
feat(instrumentation-xml-http-request): support migration to stable HTTP semconv, v1.23.1 (#5662) 2025-05-09 22:20:47 +00:00
Trent Mick 0665c854c8
refactor(sdk-node): update semconv usage to ATTR_ exports (#5668) 2025-05-09 20:39:16 +00:00
Trent Mick d07d630cea
refactor(sdk-trace-base): update semconv usage to ATTR_ exports (#5669) 2025-05-09 20:39:15 +00:00
Trent Mick bc8c94e22c
refactor(sdk-trace-node): update semconv usage to ATTR_ exports (#5670) 2025-05-09 19:29:53 +00:00
Trent Mick 4d3f899532
refactor(sdk-trace-web): update semconv usage to ATTR_ exports (#5672) 2025-05-09 19:29:44 +00:00
Trent Mick 6f72fb9646
refactor(exporter-zipkin): update semconv usage to ATTR_ exports (#5673) 2025-05-09 19:29:24 +00:00
Trent Mick ba50c08e12
refactor(shim-opentracing): update semconv usage to ATTR_ exports (#5674) 2025-05-09 19:29:14 +00:00
Trent Mick c2c9399740
refactor(exporter-prometheus): update semconv usage to ATTR_ exports (#5675) 2025-05-09 19:29:06 +00:00
Trent Mick b50f088f8a
refactor(exporter-jaeger): update semconv usage to ATTR_ exports (#5676) 2025-05-09 19:28:54 +00:00
Trent Mick 039b6b4df1
docs: update old/deprecated 'SemanticAttributes' usage (#5664) 2025-05-09 16:42:09 +00:00
Trent Mick b76281a32c
refactor(resources): update semconv usage to ATTR_ exports (#5666) 2025-05-09 16:40:04 +00:00
Colin Ihrig 6033e66530
chore: add missing reference to changelog (#5660)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-05-09 16:39:35 +00:00
Trent Mick 5954fdeb90
feat(instrumentation-fetch): support migration to stable HTTP semconv, v1.23.1 (#5651) 2025-05-08 22:09:16 +00:00
Jamie Danielson e1ec4026ed
feat(instrumentation-grpc): support migration to stable HTTP semconv (#5653) 2025-05-08 21:20:13 +00:00
Trent Mick eb4ce206b7
feat(instrumentation): New utilities for semconv stability migration for instrumentations that produce 'http' and 'db' telemetry. (#5659)
Co-authored-by: Jamie Danielson <jamiedanielson@honeycomb.io>
2025-05-08 13:42:30 +00:00
OpenTelemetry Bot 67ba9e3084
chore: prepare next release (#5655)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-05-07 17:45:28 +00:00
Marc Pichler db0616fb37
chore: temporarily disable github link checking (#5656) 2025-05-07 16:29:26 +00:00
Trent Mick eeec126479
feat(semantic-conventions): update semantic conventions to v1.33.0 (#5654) 2025-05-07 15:40:37 +00:00
Marc Pichler 60d3115390
chore: add @JacksonWeber to triagers (#5641) 2025-05-05 09:16:54 +00:00
Colin Ihrig b0e4e4f1d8
refactor(opentelemetry-core): simplify `parseKeyPairsIntoRecord()` (#5610) 2025-04-30 11:21:06 +00:00
Jackson Weber 7749d0a011
feat:(instrumentation-http) Capture Synthetic Source Type on Requests (#5488)
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-04-28 16:09:18 +00:00
Aaron Stone aca743b499
[docs] Upgrade note with Jest version requirements and workaround for older versions of Jest (#5619)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-04-28 12:19:55 +00:00
Mend Renovate cfc33f7741
chore(deps): lock file maintenance (#5638) 2025-04-28 12:19:04 +00:00
Mend Renovate 0c452201aa
chore(deps): update dependency @bufbuild/buf to v1.53.0 (#5637) 2025-04-28 11:39:16 +00:00
Marc Pichler 2ac15af496
chore: add constraint for renovate to use npm@>10.8.0 (#5632) 2025-04-28 11:36:22 +00:00
Julian Tescher 826c2d90d4
fix(instrumentation-http): stable client metrics response code (#5625)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-04-28 11:36:07 +00:00
Mend Renovate 4061f81de7
chore(deps): update dependency webpack to v5.99.7 (#5635) 2025-04-28 10:55:46 +00:00
Marc Pichler a2fab71bae
fix(sdk-node): instantiate baggage processor when env var is set (#5634) 2025-04-28 10:15:26 +00:00
Mend Renovate 6f753cca7e
chore(deps): lock file maintenance (#5630) 2025-04-24 16:36:22 +00:00
Marc Pichler 0b5736d4e1
deps(instrumentation): remove unused @types/semver dev-dependency (#5631) 2025-04-24 14:21:43 +00:00
Mend Renovate 0bbb966729
fix(deps): update all patch versions (#5609) 2025-04-23 15:40:08 +00:00
Jackson Weber 9f5ae79b1e
Fix sdk.start() as Not Async (#5617) 2025-04-23 08:11:03 +00:00
Svetlana Brennan 8efceed28c
feat(instrumentation-http)!: Remove legacy http span attributes and metrics (#5552)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-22 17:01:41 +00:00
Colin Ihrig dbbd03233e
fix(sdk-metrics): improve PeriodicExportingMetricReader() constructor input validation (#5621) 2025-04-22 12:33:13 +00:00
miguel11nines fb2fdd293f
[core] migrate away from deprecated constants in sdk-info.ts (#5593)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-16 18:45:44 +00:00
Colin Ihrig cf6dffeebc
refactor: replace assertRejects() with assert.rejects() (#5614) 2025-04-15 16:03:07 +00:00
Antoine du Hamel de3a89b1f6
fix(docs): remove WIP warning on the README (#5606)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-04-15 15:11:07 +00:00
Marc Pichler e26ecd8eda
docs: fix api doc links (#5613) 2025-04-15 15:04:24 +00:00
Colin Ihrig c89cb38d0f
test(sdk-metrics): fix multiple problematic assertRejects() calls (#5611) 2025-04-14 09:32:53 +00:00
Marc Pichler 37fe1e495b
fix(otlp-transformer): do not throw when deserializing empty JSON response (#5551) 2025-04-14 08:13:32 +00:00
ZHAO Jin-Xiang 6e15d69cb8
fix(resource): use dynamic import over require to improve ESM compliance (#5298)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-04-14 08:00:58 +00:00
OpenTelemetry Bot dac72912b3
chore: prepare next release (#5607) 2025-04-10 16:39:19 +00:00
Trent Mick b0b721ae3e
feat(semantic-conventions): update semantic conventions to v1.32.0 (#5603) 2025-04-10 16:16:21 +00:00
Mend Renovate a59448fe27
chore(deps): lock file maintenance (#5566) 2025-04-10 12:23:51 +00:00
Trent Mick 4f9b31b78a
docs: update from deprecated SEMRESATTRS_SERVICE_NAME to ATTR_SERVICE_NAME (#5604) 2025-04-10 07:35:26 +00:00
Mend Renovate 28ddef3868
chore(deps): update dependency node to v22 (#5554)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-09 21:03:45 +00:00
Michael Beemer 78f9260bd5
refactor(sdk-node): update node sdk to use env var util (#5582)
Signed-off-by: Michael Beemer <michael.beemer@dynatrace.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-09 20:28:59 +00:00
Sebastian Bejga e46bd39e8d
refactor(opentelemetry-sdk-node): use new get*FromEnv() function in NodeSDK's metrics setup (#5578)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-09 20:07:39 +00:00
OpenTelemetry Bot 141c054d2d
chore: prepare next release (#5549) 2025-04-09 19:51:10 +00:00
Trent Mick 58468728e8
feat(semantic-conventions): update semantic conventions to v1.31.0 (#5589) 2025-04-09 19:33:18 +00:00
Asstra 0f6619e0cc
refactor(instrumentation): change tests to allow use of mocha context (#5591)
Signed-off-by: Adrien Raimbault <adrien.raimbault@etu.umontpellier.fr>
2025-04-09 13:10:27 +00:00
David Luna b018f15a00
test(instr-http): add test for removing auth in http.url and url.full semantic attributes (#5592) 2025-04-09 13:09:29 +00:00
Matéo Fernandez 0808373465
feat(@opentelemetry/sdk-logs): align LoggerProvider constructor options with Trace and Metrics SDK (#5588)
Signed-off-by: Matéo Fernandez <mateo.fernandez73@gmail.com>
2025-04-09 13:06:39 +00:00
Mend Renovate 54e039c9e0
fix(deps): update dependency body-parser to v2 (#5597) 2025-04-09 13:03:31 +00:00
Mend Renovate 77cad06f40
chore(deps): update github/codeql-action action to v3.28.15 (#5599) 2025-04-09 13:02:45 +00:00
Asstra 3c452f4b20
fix(examples): use correct node tracer provider function (#5586)
Signed-off-by: Adrien Raimbault <adrien.raimbault@etu.umontpellier.fr>
2025-04-02 21:22:58 +00:00
Ole Kristian Pedersen efc640eefa
test(@opentelemetry/sdk-trace-node): refactor tests to allow use of mocha context (#5587) 2025-04-02 17:31:06 +00:00
Alexandre Gomez 2c60ac030a
refactor(resources): replace deprecated semconv consts (#5581)
Signed-off-by: Alexandre Gomez <gomez.a.corneille@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-02 17:29:09 +00:00
Ole Kristian Pedersen dd4b39c850
test(@opentelemetry/api): refactor tests to allow use of mocha context (#5584) 2025-04-02 17:27:38 +00:00
Ole Kristian Pedersen 050aafbea5
test(@opentelemetry/sdk-trace-web): refactor tests to allow use of mocha context (#5585) 2025-04-02 17:26:02 +00:00
Weyert de Boer 27eb7f12cf
refactor: use get*FromEnv() for logging setup (#5580)
Signed-off-by: Weyert de Boer <wdb@innerfuse.biz>
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-04-02 16:53:09 +00:00
Ole Kristian Pedersen a8583b82d3
fix(exporter-oltp-metrics-*): Remove forceFlush (#5579) 2025-04-02 16:43:17 +00:00
Mend Renovate 390243e308
chore(deps): update github/codeql-action action to v3.28.13 (#5568) 2025-04-02 13:06:39 +00:00
OpenTelemetry Bot c3260a4dba
Add ossf-scorecard scanning workflow (#5567)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-04-01 01:19:22 +00:00
Martin Holman b322a24b4a
fix: npm links (#5553) 2025-03-24 12:45:28 +00:00
Mend Renovate c6ab2ba488
fix(deps): update all patch versions (#5530) 2025-03-20 08:47:42 +00:00
Daniel Dyla 790dbb986c
Guard async attributes (#5544)
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-03-19 17:07:18 +00:00
Daniel Dyla 378344a740
Do not log detected resource (#5546) 2025-03-19 09:02:34 +00:00
Marc Pichler 019671e140
docs: clarify that Resource is not user-implementable (#5541) 2025-03-19 08:29:47 +00:00
Wei Zhu 0590a5c08a
docs: use ATTR_SERVICE_NAME in readme (#5542)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2025-03-18 23:16:32 +00:00
Marc Pichler f4dd2a1062
docs: update compatibility matrix (#5536) 2025-03-18 15:19:47 +00:00
Marc Pichler 7fde94081e
chore: prepare release 2.0.0/0.200.0 (#5521) 2025-03-17 15:40:53 +00:00
Trent Mick ecd67debdb
doc: add section to SDK 2.x migration guide for implementors of resource detectors (#5535) 2025-03-14 13:29:52 +00:00
Marc Pichler eaebf765d8
chore: prepare release 2.0.0-rc.1/0.200.0-rc.1 (#5534) 2025-03-12 15:16:07 +00:00
Mend Renovate e947bd93ae
chore(deps): update dependency babel-loader to v10 (#5518) 2025-03-10 12:49:37 +00:00
Mend Renovate 5e20647ffe
fix(deps): update dependency axios to v1.8.2 [security] (#5532) 2025-03-10 12:48:55 +00:00
Mend Renovate 78fc472c17
chore(deps): lock file maintenance (#5531) 2025-03-10 12:23:33 +00:00
Sriraam A S 693b09d9ac
fix(core): avoid using util in configuration.ts for browser compatibility (#5524)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-03-07 18:30:53 +00:00
Marc Pichler 92fde6aa77
chore: prepare 2.0.0-dev.1/0.200.0-dev.1 pre-release (#5512) 2025-03-05 16:50:06 +00:00
Trent Mick 04b32102f0
doc: upgrade/migration guide for SDK 2.0 (#5513)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Jamie Danielson <jamiedanielson@honeycomb.io>
2025-03-05 07:00:44 +00:00
Mend Renovate cb4826635a
fix(deps): update dependency import-in-the-middle to v1.13.1 (#5517) 2025-03-03 09:52:04 +00:00
Mend Renovate 8e5049877a
chore(deps): update all patch versions (#5510) 2025-02-26 17:53:15 +00:00
Marc Pichler d240d37ec4
feat(core)!: drop unused constants (#5504) 2025-02-25 10:06:23 +00:00
Marc Pichler 455a352b6a
fix(sdk-trace-base)!: use parent-base-always-on on incorrect input (#5494) 2025-02-25 09:29:38 +00:00
Mend Renovate d9eae58155
chore(deps): lock file maintenance (#5508) 2025-02-24 18:32:31 +00:00
Marc Pichler 544c409847
feat(sdk-trace-base)!: remove BasicTracerProvider#register() to improve tree-shaking (#5503) 2025-02-24 16:27:52 +00:00
Mend Renovate 537eaf9fc0
fix(deps): update all patch versions (#5440) 2025-02-24 16:09:41 +00:00
Mend Renovate 7d6e11e02f
chore(deps): update dependency webpack-cli to v6 (#5502) 2025-02-24 08:51:26 +00:00
Marc Pichler 2053f0d3a4
chore: prepare 2.0.0-dev.0/0.200.0-dev.0 release (#5498) 2025-02-21 12:04:54 +00:00
Marc Pichler de5f1dab8c
ci: add `canary` dist-tag when publishing from main (#5496) 2025-02-21 09:22:47 +00:00
David Luna f2d4e54975
feat!: set compilation target to `es2022` for all packages but api and semantic-conventions (#5456)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-02-21 08:16:15 +00:00
Marc Pichler 492ed355cb
deps: clean up dependencies (#5484) 2025-02-19 11:14:29 +00:00
Marc Pichler 5ccf3809b9
feat(resources): use functions over constants for default and empty resources (#5467) 2025-02-19 11:11:36 +00:00
Marc Pichler faeae98653
feat(core): drop getEnv(), getEnvWithoutDefaults() (#5481) 2025-02-19 11:11:25 +00:00
Marc Pichler d004d41b5a
docs(sdk-metrics): align documentation with current state (#5485) 2025-02-19 11:11:16 +00:00
Marc Pichler 0cdf9eea80
docs(resources): align documentation with current state (#5486) 2025-02-19 11:11:08 +00:00
Jackson Weber 1afa8ba514
feat(sdk-trace-base)!: Add parentSpanContext and remove parentSpanId (#5450)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-02-18 17:08:25 +00:00
OpenTelemetry Bot 14d55d8641
Add FOSSA scanning workflow (#5482)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-02-18 12:42:03 +00:00
Logan Rosen e9d3c71918
docs: update Contributing Guide (#5479) 2025-02-17 11:28:31 +00:00
Marc Pichler e4381fcb18
feat(sdk-trace-base)!: do not read environment variables from window (#5455)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-02-17 11:19:51 +00:00
Marc Pichler 1a5b57b7f3
feat(exporter-metrics-otlp-http)!: do not read environment variables from window (#5473)
Co-authored-by: David Luna <david.luna@elastic.co>
2025-02-17 10:19:49 +00:00
Marc Pichler cc7aa3c724
feat(exporter-zipkin)!: do not read environment variables from window (#5465) 2025-02-17 10:11:43 +00:00
Marc Pichler 52d033171a
refactor(instrumentation-http): migrate away from getEnv() (#5469) 2025-02-17 10:10:38 +00:00
Marc Pichler 5c90aec9af
feat(sdk-logs)!: do not read environment variables from window (#5472) 2025-02-17 09:57:22 +00:00
Marc Pichler 5b988c892d
feat: migrate sdk-node away from getEnv(), introduce diagLogLevelFromString() util (#5475)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-02-17 09:49:21 +00:00
Godfrey Chan c27fbc6d49
refactor(context-zone-peer-dep): fix eslint warnings (#5371) 2025-02-13 19:33:33 +00:00
Marius Müller 7a1e1b274f
feat(exporter-prometheus): add additional attributes option (#5317)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-02-13 18:57:50 +00:00
Marc Pichler 60f2ce9b73
feat(resources)!: do not read environment variables from window (#5466) 2025-02-13 17:24:19 +00:00
Marylia Gutierrez 3c65b56d6f
chore: fix repo parameter (#5468) 2025-02-13 17:05:56 +00:00
Marc Pichler b526ec99d7
refactor(exporter-jaeger): migrate away from getEnv() (#5464) 2025-02-13 16:00:20 +00:00
Daniel Dyla 4b8ae0c2bf
feat(resource)!: Remove resource class export in favor of functions and types only to aid in cross-version compatibility (#5421)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-02-13 11:12:44 +00:00
Patrick Lafrance 7438735af7
feat(opentelemetry-instrumentation-fetch): added a requestHook option (#5380)
Signed-off-by: patricklafrance <pa.lafrance@gmail.com>
2025-02-13 09:31:47 +00:00
Daniel Dyla 2d5671aeec
Remove duplicate browser detector (#5420)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-02-13 08:43:15 +00:00
Marylia Gutierrez e7865c67d8
chore: add workflow for surveys of non-members (#5411) 2025-02-12 17:06:07 +00:00
Roshini Prasad bc6c4ebb7f
docs(opentelemetry-readme): Updated circleci badge with github action badge (#5457) 2025-02-12 16:39:43 +00:00
Anuraag (Rag) Agrawal afcc71158b
fix(sdk-trace-base): always wait on pending export in SimpleSpanProcessor (#5303) 2025-02-12 13:10:22 +00:00
Trent Mick fcd96deb78
chore: add 'lint:semconv-deps' (#5451) 2025-02-12 11:08:15 +00:00
Marc Pichler 1ed613c248
feat(core): add more scalable replacements for getEnv(), getEnvWithoutDefaults() (#5443) 2025-02-12 10:24:01 +00:00
OpenTelemetry Bot 9feaee3ff5
chore: prepare next release (#5452) 2025-02-12 00:34:58 +00:00
Trent Mick b6fa2b9e4d
feat(semantic-conventions): update semantic conventions to v1.30.0 (#5433) 2025-02-11 23:53:38 +00:00
Marc Pichler 4fb9c5aba9
refactor(web-common): add incubating semconv to package (#5446) 2025-02-11 13:53:04 +00:00
Trent Mick 4f91c1d590
doc: list all current javascript-contrib-triagers members (#5430) 2025-02-11 13:00:16 +00:00
Trent Mick 824814f783
chore: unpin semantic-conventions package dep (#5439) 2025-02-11 12:22:27 +00:00
Trent Mick abf31e17f8
chore: tweak the section titles for changelogs (#5432) 2025-02-11 10:52:14 +00:00
Marc Pichler 94059f7cf7
feat(core)!: remove unused/obsolete functions and types (#5444) 2025-02-11 09:18:58 +00:00
Mend Renovate 99091be9d4
chore(deps): update dependency babel-loader to v9 (#5441) 2025-02-10 08:40:23 +00:00
Trent Mick 3b65dee7bd
chore: temporarily disable API docs updates while main is frozen for releases (#5436) 2025-02-10 08:38:25 +00:00
Marc Pichler b9d5aeeb22
docs(api): bring back detailed api documentation (#5434) 2025-02-07 18:53:58 +00:00
Godfrey Chan e744798957
refactor(instrumentation-xhr): fix eslint warnings (#5402) 2025-02-06 23:43:34 +00:00
OpenTelemetry Bot 6508845fa6
chore: prepare next release (#5431) 2025-02-06 20:40:30 +00:00
Trent Mick 9030b3e7bd
doc(semantic-conventions): add generated changelog details for the previously released v1.28.0 (#5428) 2025-02-06 20:13:58 +00:00
Trent Mick a6bb7a321d
chore(semantic-conventions): whitespace-only fixes in comments from weaver 0.12.0 (#5427) 2025-02-06 17:36:32 +00:00
Godfrey Chan 4001f626d9
refactor(resources): fix eslint warning (#5383) 2025-02-06 10:50:43 +00:00
Mend Renovate 41beed70a3
chore(deps): lock file maintenance (#5414) 2025-02-06 10:48:46 +00:00
Jamie Danielson e9f84cbeef
fix(exporter-logs/trace-otlp-grpc): fix error for missing dependency otlp-exporter-base (#5412) 2025-02-06 10:31:10 +00:00
Trent Mick 241c046ccd
chore: remove obsolete comment (#5426) 2025-02-06 10:23:06 +00:00
Trent Mick 2d4e1cac7c
feat(semantic-conventions): update semantic conventions to v1.29.0 (#5356)
Co-authored-by: Jamie Danielson <jamiedanielson@honeycomb.io>
2025-02-06 01:14:00 +00:00
Trent Mick d803022ba3
docs: add 'Contrib Triagers' section to the README (#5425) 2025-02-05 23:28:44 +00:00
Godfrey Chan 57f37eeb31
refactor(sdk-trace-base): fix eslint warnings (#5385) 2025-02-05 23:28:19 +00:00
Richard Gibson e25de957f4
docs: Fix Markdown typo (#5417) 2025-02-05 20:33:53 +00:00
Trent Mick 34a2dd574c
test: Test Node.js 23 in CI (#5416) 2025-02-05 20:04:04 +00:00
Godfrey Chan 39e9a09694
refactor(otlp-exporter-base): fix eslint warnigns (#5391) 2025-02-05 18:28:29 +00:00
Godfrey Chan b5885e90e6
refactor(instrumentation-grpc): fix eslint warnings (#5408) 2025-02-05 18:08:11 +00:00
Daniel Dyla 595d0e9c0d
Converge sync and async resources (#5350) 2025-02-03 19:52:16 +00:00
Marc Pichler f9fda8baef
feat(sdk-trace-*):! drop unintentional/unnecessary exports (#5405) 2025-01-31 14:19:21 +00:00
Trent Mick 7332f3a863
chore!: bump min-supported node to ^18.19.0 || >=20.6.0 (#5397)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-31 09:18:27 +00:00
Marc Pichler 15ba2d7da3
feat(core)!: remove TracesSamplerValues from exports (#5406) 2025-01-31 08:52:40 +00:00
Trent Mick 05c2869ada
chore(semantic-conventions): restore min-supported node to >=14 (#5407) 2025-01-31 08:52:08 +00:00
Godfrey Chan 29d0da559b
refactor(instrumentation-fetch): fix eslint warnings (#5401) 2025-01-30 16:40:10 +00:00
Mend Renovate c513965062
chore(deps): update dependency gh-pages to v6.3.0 (#5403) 2025-01-30 15:40:21 +00:00
Mend Renovate 5903906d10
chore(deps): update dependency mocha to v11.1.0 (#5404) 2025-01-30 15:38:45 +00:00
Godfrey Chan bb212334c7
refactor(exporter-metrics-otlp-http): fix eslint warning (#5396) 2025-01-30 12:38:07 +00:00
Marc Pichler e265e47e98
feat(sdk-trace-base)!: drop ability to auto-instantiate propagators beyond defaults (#5355)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-01-30 12:33:13 +00:00
Godfrey Chan a04284ccdc
refactor(exporter-*): remove `export * from ...` (#5399) 2025-01-30 12:32:18 +00:00
Godfrey Chan 27bdf71519
[instrumentation-fetch] Use `msw` for fetch instrumentation tests (#5282)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-30 12:01:02 +00:00
Godfrey Chan 3c040c4ef0
fix(inst-fetch,inst-xhr) Ignore network events with zero-timing (#5332) 2025-01-29 17:49:04 +00:00
Godfrey Chan 1c6c39b454
refactor(core): fix eslint warning (#5382) 2025-01-29 11:57:53 +00:00
Godfrey Chan a686b88bf5
refactor(browser-detector): fix eslint warning (#5384) 2025-01-29 11:54:56 +00:00
Godfrey Chan 22569aca32
fix(exporter-zipkin): remove deprecated `url.parse` usage (#5390) 2025-01-29 11:53:18 +00:00
Godfrey Chan 2759d73ed5
refactor(sdk-trace-node): fix eslint warning (#5387) 2025-01-29 10:17:47 +00:00
Marc Pichler 23adb2bdc5
docs(instrumenation-http): reword documentation about what is geneated (#5378) 2025-01-29 10:12:46 +00:00
Godfrey Chan 682ab65f7c
refactor(sdk-trace-web): fix eslint warning (#5388) 2025-01-29 10:12:21 +00:00
Godfrey Chan d2812d2810
refactor(instrumentation): fix eslint warnings (#5389) 2025-01-29 10:08:18 +00:00
Godfrey Chan e966dc535b
refactor(sdk-metrics): fix eslint warning (#5386) 2025-01-29 09:57:47 +00:00
Serkan ÖZAL e42fbb985f
feat(opentelemetry-instrumentation): replace `semver` package with internal semantic versioning check implementation (#5305)
Co-authored-by: Trent Mick <trentm@gmail.com>
2025-01-28 22:57:04 +00:00
Marc Pichler 199fd8ddd3
feat(sdk-trace-web): do not throw when passing extra options (#5357) 2025-01-27 16:38:27 +00:00
Colin Ihrig 321c31f442
refactor(exporter-prometheus): remove unnecessary `isNaN()` check (#5377) 2025-01-27 16:10:04 +00:00
Colin Ihrig c43f17238c
feat(instrumentation-grpc): monitor error events with events.errorMonitor (#5369)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-27 16:00:02 +00:00
Colin Ihrig bdc0e3a34c
chore(instrumentation-grpc): remove unused `findIndex()` function (#5372)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-27 09:44:10 +00:00
Mend Renovate 2a26d08b2e
chore(deps): update all patch versions to v7.26.7 (#5375) 2025-01-27 09:19:35 +00:00
Colin Ihrig 3e013cfd8f
refactor(otlp-exporter-base): remove unnecessary `isNaN()` checks (#5374) 2025-01-27 09:12:34 +00:00
Godfrey Chan f927e82b1d
doc: migrate away from defunct `addMetricReader` in examples (#5349) 2025-01-24 09:09:31 +00:00
Neil Fordyce 0ae25f191e
feat(sdk-trace-base): add stack trace to operation on ended Span warning (#5363)
Co-authored-by: Victor <Zeusvictor88@gmail.com>
2025-01-23 20:15:04 +00:00
Colin Ihrig b4ae9ca61d
feat(sdk-node): lower diagnostic level (#5360)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-23 20:04:43 +00:00
Marc Pichler df49fb1893
feat(sdk-metrics)!: extract IMetricReader interface and use it over abstract class (#5311) 2025-01-23 16:00:39 +00:00
David Luna 34475825e8
chore: update `module` config in tsconfig.base.json (#5347)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-23 10:35:36 +00:00
Marc Pichler c00f36ee43
feat(sdk-trace)!: remove ability to have BasicTracerProvider instantiate exporters (#5239) 2025-01-21 12:41:10 +00:00
Connor Pearson 6c04a41443
feat(instrumentation): re-export initialize from import-in-the-middle (#5123)
Signed-off-by: Connor Pearson <connor.pearson@mailbox.org>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-20 16:22:40 +00:00
Mend Renovate 56c7522693
chore(deps): update dependency markdownlint-cli2 to v0.17.2 (#5352) 2025-01-20 16:02:49 +00:00
Mend Renovate bb22068a27
chore(deps): update dependency eslint-config-prettier to v10 (#5353) 2025-01-20 16:02:06 +00:00
Mend Renovate fc0edd82f6
chore(deps): update dependency webpack-cli to v6 (#5336) 2025-01-13 15:12:36 +00:00
Mend Renovate 95a190a5ac
chore(deps): update dependency ts-loader to v9.5.2 (#5335) 2025-01-13 14:27:55 +00:00
Marc Pichler 6d83f80c13
feat(core)!: remove deprecated samplers (#5316) 2025-01-13 14:25:59 +00:00
Jackson Weber 13e951a001
fix(sdk-metrics) Don't Export from PeriodicExportingMetricReader with No Metrics (#5288)
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-13 14:25:05 +00:00
Marc Pichler 6f18ec24d2
test(instrumentation-http): remove tests for deprecated request package (#5328) 2025-01-13 14:21:32 +00:00
Trent Mick cb88833234
fix(exporter-metrics-otlp-http): browser OTLPMetricExporter was not passing config to OTLPMetricExporterBase super class (#5331) 2025-01-13 09:19:23 +00:00
Mend Renovate 6864c2f785
chore(deps): update dependency superagent to v10.1.1 (#5327) 2025-01-10 18:03:08 +00:00
Mend Renovate ebdc3144f2
chore(deps): update dependency @bufbuild/buf to v1.49.0 (#5325) 2025-01-10 17:55:27 +00:00
Mend Renovate 70755a6a80
chore(deps): update dependency nock to v13.5.6 (#5326) 2025-01-10 17:54:44 +00:00
Mend Renovate 37015ee9de
chore(deps): update dependency webpack-cli to v6 (#5294) 2025-01-10 17:30:52 +00:00
Mend Renovate 513ef0d7fb
chore(deps): update dependency markdownlint-cli2 to v0.17.1 (#5321) 2025-01-10 17:28:53 +00:00
Mend Renovate ec638dc193
chore(deps): lock file maintenance (#5323) 2025-01-10 17:02:33 +00:00
Marc Pichler a37692abc7
feat(core)!: remove depreacted IdGenerator and RandomIdGenerator (#5309) 2025-01-10 16:54:44 +00:00
Mend Renovate d35fbab151
chore(deps): update dependency nyc to v17 (#5320) 2025-01-10 16:40:48 +00:00
Mend Renovate 52af860553
chore(deps): update dependency typedoc to v0.27.6 (#5319) 2025-01-10 16:28:43 +00:00
Mend Renovate 12bde40fb6
chore(deps): update dependency babel-loader to v9 (#5318) 2025-01-10 16:17:28 +00:00
Mend Renovate ec9429711e
chore(deps): update dependency typedoc-plugin-missing-exports to v3.1.0 (#5244) 2025-01-10 16:09:44 +00:00
Marc Pichler 4a6021af7a
feat(core)!: remove deprecated InstrumentationLibrary (#5308) 2025-01-10 10:20:09 +00:00
Trent Mick c408d21bb6
chore(selenium-tests): remove internal selenium-tests/ package, it wasn't being used (#5312) 2025-01-09 18:28:42 +00:00
David Luna fddcd199a0
chore!: update typescript to version `5.0.4` (#5145)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2025-01-09 16:49:52 +00:00
Trent Mick 643f2bbfc4
chore(deps): remove unused 'semver' deps from some packages (#5306) 2025-01-09 09:58:49 +00:00
Godfrey Chan 3b56060c51
feat(sdk-metrics)!: drop deprecated `type` field on `MetricDescriptor` (#5291) 2025-01-08 18:05:24 +00:00
Godfrey Chan 04e74d7846
feat(instrumentation-fetch)! Passthrough original request to `applyCustomAttributes` (#5281) 2025-01-08 16:30:06 +00:00
Mend Renovate 42eb824f2f
chore(deps): update dependency chromedriver to v131.0.4 (#5285) 2025-01-07 15:39:44 +00:00
Mend Renovate f44bf10459
chore(deps): lock file maintenance (#5295) 2025-01-07 15:29:52 +00:00
Mend Renovate b2d02d2cc0
chore(deps): update dependency webpack-merge to v6 (#5270) 2025-01-07 14:15:12 +00:00
Godfrey Chan 369d85adbf
chore(deps): update dependency webpack-dev-server to v5 (#5292) 2025-01-07 13:49:26 +00:00
Marc Pichler fa5edc639c
chore(deps): remove webpack-merge where it is not needed (#5289) 2025-01-07 13:17:33 +00:00
Godfrey Chan 9c46e8f87d
[instrumentation-fetch] refactor fetch() tests for clarity, type safety and realism (#5268) 2025-01-07 13:14:29 +00:00
David Luna 90afa2850c
feat(sdk-*)!: align merge resource behavior with spec (#5219)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-12-20 13:38:22 +00:00
Godfrey Chan 8dc74e609a
feat(sdk-metrics)!: Drop deprecated `InstrumentDescriptor` export (#5266) 2024-12-19 13:23:40 +00:00
Godfrey Chan 347dd5f692
chore: update supported versions in 2.0 README (#5287) 2024-12-19 08:41:49 +00:00
Marc Pichler 107637ea28
Merge pull request #5284 from dynatrace-oss-contrib/next-main-2024-12-16
[SDK 2.0] merge changes from `next` to `main`
2024-12-18 19:04:11 +00:00
Marc Pichler 2610521b16 docs: merge changelog and readme 2024-12-18 17:47:46 +01:00
Marc Pichler b8d7966b86
Merge pull request #5275 from dynatrace-oss-contrib/next-main-2024-12-16
[next] merge changes from main
2024-12-18 17:11:48 +01:00
Marc Pichler 4179ddb26c Merge branch 'main' into next-main-2024-12-16 2024-12-18 11:16:17 +01:00
OpenTelemetry Bot 616d27a0a1
chore: prepare next release (#5274)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-12-18 09:49:03 +00:00
Mingaudas Vagonis e524148b48
chore: removed circular dependency from BasicTracerProvider (#5279) 2024-12-18 09:08:09 +00:00
David Ashpole 67a0e9cb0c
Update links to openmetrics to reference the v1.0.0 release (#5267) 2024-12-18 09:04:27 +00:00
Godfrey Chan 0c11fc6325
Fix incorrect CHANGELOG entry on main (`v1.next`) (#5280) 2024-12-18 08:56:01 +00:00
Marc Pichler 8ab52d5479
fix(ci): adapt workflow to use supported npm versions (#5277) 2024-12-17 15:40:03 +00:00
Marc Pichler a8befa6814 Merge branch 'main' into next-main-2024-12-16 2024-12-16 18:03:47 +01:00
Godfrey Chan 6d7a73aa85
refactor(sdk-metrics) Swap workaround types for @otel/api types (#5254) 2024-12-13 18:38:43 +01:00
Marc Pichler 84cce75361
refactor(otlp-transformer): re-structure package to prepare for separate entrypoints (#5264) 2024-12-13 16:14:37 +00:00
Bhaskar Banerjee 6d31a18c34
feat(opentelemetry-sdk-node): automatically configure metrics exporter based on environment variables (#5168)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-12-13 11:33:47 +00:00
Godfrey Chan e03b6e7caa
chore: update prettier to 3.4.2 (#5261) 2024-12-13 11:07:06 +00:00
Arriana Blais e4d9c213f6
fix(instrumentation-fetch, instrumentation-xml-http-request) content length attributes now prese (#5230) 2024-12-12 15:35:41 +00:00
Trent Mick bdee949b8a
doc(semantic-conventions): clarify suggested usage of *unstable* semconv (#5256) 2024-12-12 15:07:44 +00:00
Mend Renovate 61d5a0e291
chore(deps): update dependency chromedriver to v131.0.3 (#5255) 2024-12-12 10:46:43 +00:00
Marc Pichler 887ff1cd6e
docs: re-categoize misplaced changelog entry (#5248) 2024-12-10 15:53:32 +00:00
Michele Azzolari 79e28759f0
feat(sdk-metrics): PeriodicExportingMetricReader now flushes pending tasks at shutdown (#5242) 2024-12-10 15:52:18 +00:00
Marc Pichler 5387343986
test(api): longer timeout for API tree-shaking tests (#5247) 2024-12-10 09:11:45 +00:00
Marc Pichler 9328790c54
docs: document compatible versions (#5246) 2024-12-09 16:41:37 +00:00
Mend Renovate 484af40805
fix(deps): update dependency express to v4.21.2 (#5238) 2024-12-06 09:07:41 +00:00
Marc Pichler 0bc4af6cd8
ci: run browser and worker tests on Node.js 22 (#5237) 2024-12-05 19:41:41 +00:00
Marc Pichler eb81e286c0
Merge pull request #5236 from dynatrace-oss-contrib/next-main-2024-12-04
[next] merge changes from main
2024-12-05 17:21:38 +01:00
Marc Pichler a761a8c4cf
feat(otlp-transformer)!: remove internal types and functions from public API (#5200) 2024-12-05 13:11:01 +00:00
Marc Pichler 47212bb4e1 fix: remove accidentally re-added empty files 2024-12-04 22:50:39 +01:00
Marc Pichler a8b4cd2b9d Merge branch 'main' into next-main-2024-12-04 2024-12-04 22:32:06 +01:00
Mend Renovate 569346ba7b
fix(deps): update all patch versions (#5228) 2024-12-04 19:30:15 +00:00
Luca Casonato 97dff5b375
fix(sdk-trace-base): don't load envs top level (#5233) 2024-12-04 19:29:43 +00:00
OpenTelemetry Bot 85dcbc7c55
chore: prepare next release (#5232) 2024-12-04 16:08:33 +00:00
Marc Pichler b0f73ea11d
fix: de-confuse Nuxt build tooling by not using 'export *' in comments (#5227) 2024-12-03 21:59:48 +00:00
Mend Renovate c9b5bb0bfe
chore(deps): lock file maintenance (#5225) 2024-12-02 09:01:57 +00:00
Marc Pichler fc94e4669a
feat(otlp-exporter-base): implement partial success handling (#5183) 2024-11-28 17:42:15 +00:00
David Luna 810b6183dc
refactor(sdk-trace-base): rename `activeSpanProcessor` private property (#5211) 2024-11-27 20:32:05 +01:00
Mend Renovate fd7f2d951b
fix(deps): update dependency zone.js to v0.15.0 (#5213) 2024-11-27 18:43:54 +00:00
Mend Renovate 17bf0d9a34
chore(deps): update dependency @bufbuild/buf to v1.47.2 (#5210) 2024-11-27 18:35:08 +00:00
Marc Pichler 1249e34591
refactor(otlp-exporter-base): remove exports that were meant to be internal (#5212) 2024-11-27 18:34:07 +00:00
Trivikram Kamat 5ad0aa544b
chore: replace deprecated String.prototype.substr() with substring() (#5209) 2024-11-27 16:10:35 +00:00
Marc Pichler 3bf12847d1
feat(otlp-exporter-base): add http response body to exporter error (#5204) 2024-11-27 09:14:59 +00:00
Trivikram Kamat 561f8ad3a3
fix(docs): broken link for community contribution lifecycle and processes (#5206) 2024-11-27 09:14:23 +00:00
Mend Renovate e80879e093
fix(deps): update dependency axios to v1.7.8 (#5202) 2024-11-26 11:06:05 +00:00
Marc Pichler c9fa209bf9
chore(otlp-exporter-*-grpc): clean up tests (#5196) 2024-11-26 09:58:23 +00:00
Marc Pichler e35f3d659e
chore(exporter-otlp-*-http): clean up tests (#5198) 2024-11-26 09:13:48 +00:00
Marc Pichler 556eecf0f9
chore(otlp-exporter-*-proto): clean up tests (#5199)
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-11-26 08:43:23 +00:00
Marc Pichler e250a0f30b
chore: update prettier to 3.3.3 (#5195)
Co-authored-by: Mend Renovate <bot@renovateapp.com>
2024-11-25 14:18:25 +00:00
Mend Renovate 3a20ed60b0
chore(deps): lock file maintenance (#5194) 2024-11-25 09:16:11 +00:00
David Luna c28abacee5
refactor(sdk-trace-base): make resource private and remove getActiveSpanProcessor API (#5192) 2024-11-25 10:06:31 +01:00
Marc Pichler 1e312c2088
refactor(otlp-exporter-base): don't create blob before sending xhr (#5193) 2024-11-25 09:02:14 +00:00
Mend Renovate ef80821f94
chore(deps): update all patch versions (#5189) 2024-11-21 14:11:00 +00:00
David Luna f3a6310733
refactor(sdk-trace-base): remove `_registeredSpanProcessors` from BasicTracerProvider (#5177) 2024-11-21 14:10:10 +01:00
OpenTelemetry Bot e97cc2ee8e
chore: prepare next release (#5186) 2024-11-20 19:13:20 +00:00
Trent Mick d8bc6b283b
feat(semconv): update semantic conventions to 1.28.0 (#5181) 2024-11-20 17:14:31 +00:00
Marc Pichler ef30dbc94d
docs: fix changelog formatting (#5185) 2024-11-20 16:44:20 +00:00
Marc Pichler dd5b5fbd11
feat(otlp-exporter-base): internally accept a http header provider function only (#5179) 2024-11-20 16:19:36 +00:00
Povilas Versockas a834861418
feat(sdk-metrics): add aggregation cardinality limit (#5128)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-11-20 16:08:54 +00:00
Marc Pichler 91b9abdf21
feat(otlp-transformer)!: accept ResourceMetrics instead of ResoruceMetrics[] in metrics serializers (#5159) 2024-11-20 14:06:33 +00:00
Trent Mick b7c03d29a4
chore(semantic-conventions): docs on entry-points, deprecations; improve some deprecation messages (#5166)
Co-authored-by: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-11-20 12:13:56 +00:00
Mend Renovate 0ee9a27694
chore(deps): update dependency gh-pages to v6.2.0 (#5174) 2024-11-19 16:37:58 +00:00
Mend Renovate 8ad1304098
chore(deps): update dependency linkinator to v6.1.2 (#5175) 2024-11-19 16:20:32 +00:00
Mend Renovate 2a5e0d8224
chore(deps): update dependency markdownlint-cli2 to v0.15.0 (#5176) 2024-11-19 15:54:42 +00:00
Marc Pichler 7e98761bc6
feat(exporters)!: collapse base classes into one (#5031) 2024-11-19 13:47:43 +00:00
Mend Renovate 1370810663
chore(deps): update codecov/codecov-action action to v5 (#5170) 2024-11-18 13:11:13 +00:00
OpenTelemetry Bot 4b1ad3fda0
chore: prepare next release (#5141) 2024-11-18 10:17:34 +00:00
Marc Pichler 9e4d36cb3e
fix(otlp-exporter-base): fix unhandled error when writing to destroyed http request (#5163) 2024-11-18 09:54:10 +00:00
Daniel Dyla d3630afb35
doc: document breaking change in 0.54 (#5169)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2024-11-18 08:50:56 +00:00
Mend Renovate 09a630d304
chore(deps): lock file maintenance (#5171) 2024-11-18 08:47:32 +00:00
Mend Renovate 473bb5edcd
chore(deps): lock file maintenance (#5157) 2024-11-15 21:45:04 +00:00
Mend Renovate 23a47d3fed
chore(deps): update dependency webpack to v5.96.1 (#5164) 2024-11-15 20:36:38 +00:00
Mend Renovate 6096f7238d
chore(deps): update dependency mocha to v10.8.2 (#5162) 2024-11-15 10:43:21 +00:00
Mend Renovate 1aa158bf98
chore(deps): update babel monorepo (#5161) 2024-11-15 09:56:21 +00:00
Trent Mick 363c003a95
fix(semantic-conventions): update deprecated messages for some old constants (#5160) 2024-11-15 09:55:51 +00:00
Marc Pichler 0c268e7127
feat: improve bug template (#5086)
Co-authored-by: Marylia Gutierrez <maryliag@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-11-15 09:32:10 +00:00
Mend Renovate 44465081c8
chore(config): migrate renovate config (#5158) 2024-11-14 17:01:31 +00:00
Mend Renovate 5bf7e8957e
chore(deps): update dependency chromedriver to v131 (#5156) 2024-11-14 17:00:58 +00:00
Marc Pichler d51fa95a6f
test(instrumentation): skip unwrap tests for esm (#5153)
Co-authored-by: Mend Renovate <bot@renovateapp.com>
2024-11-14 16:11:44 +00:00
David Luna b7343ef3e0
feat(sdk-trace-base)!: remove `addSpanProcessor` API (#5152) 2024-11-14 17:10:14 +01:00
Mustafa Haddara c78a02fe74
Track request body size in XHR and Fetch instrumentations (#4706)
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-11-14 15:51:55 +00:00
Daniel Dyla 56a0308297
fix(sdk-trace): performance.now() may return the same value for consecutive calls (#5150)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-11-14 15:22:04 +00:00
Marc Pichler 4afc190d90
fix(sdk-trace-base): pass BatchSpanProcessor#forceFlush() errors on visibilitychange/pagehide to globalErrorHandler (#5143)
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
2024-11-14 09:13:18 +00:00
Marc Pichler a833d9c443
Merge pull request #5144 from dynatrace-oss-contrib/next-main-
[next] merge changes from main
2024-11-13 18:10:49 +01:00
Bruno Heridet 699b9194ba
fix(sdk-node): fix typo `FomEnv` → `FromEnv` (#5146) 2024-11-13 13:43:18 +00:00
Marc Pichler 4a394cc8d7 Merge branch 'main' into next-main- 2024-11-12 17:23:44 +01:00
David Luna db14633cc4
feat(sdk-trace-base): add `spanProcessors` property in `TracerConfig` interface (#5138) 2024-11-12 15:48:00 +00:00
Omar Hassane f1ef5960ae
fix(instrumentation-http): iterating through the OTEL_SEMCONV_STABILITY_OPT_IN content instead of the entry indices (#5137) 2024-11-12 04:36:41 +00:00
Marc Pichler 8483b68f2d
fix(sdk-metrics): await export when async attributes are pending (#5126) 2024-11-11 09:25:30 +00:00
Marc Pichler 012dc9e742
feat(sdk-*): add option to opt-out from merging the resource with Resource.default() (#4617)
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-11-11 09:25:01 +00:00
Trent Mick 4b5c21cede
chore(semantic-conventions): bump weaver; use comment filter rather than deprecated comment_with_prefix (#5100) 2024-11-08 20:25:06 +00:00
Marc Pichler 87bd98edd2
fix(instrumentation-http)!: drop url.parse in favor of URL constructor (#5091) 2024-11-08 16:54:37 +00:00
Marc Pichler 030aff30f7
feat(instrumentation-http)!: reduce public API surface by removing exports and making protected methods private (#5124)
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
2024-11-08 16:39:06 +00:00
OpenTelemetry Bot 72c9af9198
chore: prepare next release (#5120) 2024-11-07 12:42:00 +00:00
Serkan ÖZAL fe4d368900
Fix wrapping ESM files with absolute path (#5094)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2024-11-06 18:52:31 +00:00
OpenTelemetry Bot 6f4f3fcefd
chore: prepare next release (#5115) 2024-11-05 16:00:32 +00:00
zyoshi (kamitsuk) 33dbde1ede
add reset function test for InMemorySpanExporter (#5107)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-11-05 11:04:31 +00:00
pmlanger 67d771869b
fix(instrumentation-http): skip malformed forwarded headers (#5099) 2024-11-05 11:01:54 +00:00
Mend Renovate ce5bbfb05c
chore(deps): update node.js to v22 (#5109) 2024-11-04 12:57:06 +00:00
Marc Pichler 4c0921ee64
docs: update releasing.md to mention npm publish workflow, fix a link to release PR workflow (#5087) 2024-11-04 12:55:10 +00:00
Annosha 2b73d37c9c
[Fixes # 4533] Replaced cpx2 with local test module (#5077)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Raphaël Thériault <113933910+raphael-theriault-swi@users.noreply.github.com>
Co-authored-by: Jakub Ziółkowski <jakub@rho.co>
Co-authored-by: David Luna <david.luna@elastic.co>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marylia Gutierrez <marylia.gutierrez@grafana.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Mercy Bassey <57226464+mercybassey@users.noreply.github.com>
Co-authored-by: OpenTelemetry Bot <107717825+opentelemetrybot@users.noreply.github.com>
2024-11-04 12:54:09 +00:00
OpenTelemetry Bot eb3ca4fb07
chore: prepare next release (#5068) 2024-10-23 14:30:12 +00:00
Marc Pichler 6fee82d868
chore: add @maryliag to approvers (#5083) 2024-10-23 14:11:03 +00:00
Marc Pichler 50d59ca938
feat(instrumentation-http)!: remove deprecated ignore options (#5085) 2024-10-23 11:20:28 +00:00
Mercy Bassey 4497ee3831
Added limitation in ot-shim readme (#5072)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-23 11:16:24 +00:00
Marc Pichler 006fe44e56
chore: move xray and xray-lambda propagators to contrib (#4966) 2024-10-23 09:22:55 +00:00
Marc Pichler 330172c1d8
fix(instrumentation-http): add server attributes after they become available (#5081) 2024-10-23 09:15:16 +00:00
Trent Mick 55a1fc88d8
fix(instrumentation-http): fix http/https ESM instr for 'import defaultExport from' style (#5075) 2024-10-22 19:47:13 +00:00
David Luna 508946c853
refactor(sdk-trace-base)!: remove Span class from exports (#5048)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-21 17:54:00 +02:00
Mend Renovate 5e1736130e
chore(deps): update dependency chromedriver to v130 (#5080) 2024-10-21 11:13:15 +00:00
Marylia Gutierrez be1737fc46
chore: add markdown lint check to default lint command (#5074)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-17 16:07:36 +00:00
Marc Pichler c208991123
test: use venv in w3c trace context test script (#5071) 2024-10-17 07:55:04 +00:00
Marc Pichler 7ed67f98c2
test(otlp-grpc-exporter-base): do not use hard-coded version in tests, touch up changelog entries (#5069) 2024-10-15 07:21:41 +00:00
Marc Pichler a1442fec01
ci: add workflow to publish packages to npm (#5067) 2024-10-14 15:50:56 +00:00
Annosha 7293e69c1e
Added custom test instructions for browser-specific tests (#5056)
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-14 09:29:39 +00:00
Nev dcc1a874d3
docs: [Browser] Define the support browser runtimes (#5059)
Co-authored-by: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com>
2024-10-14 11:25:19 +02:00
Jakub Ziółkowski 6be903a902
fix(resources): wait for async attributes for detecting resources (#4687)
Co-authored-by: David Luna <david.luna@elastic.co>
2024-10-11 20:59:41 +00:00
Marc Pichler cc8c54ae40
Merge pull request #5052 from dynatrace-oss-contrib/next-main-2024-10-08
[next] merge changes from main
2024-10-10 10:02:28 +02:00
Raphaël Thériault 039db0b3fc
fix(exporter-logs-otlp-proto): Use correct config type in constructor (#5058) 2024-10-10 08:01:10 +00:00
Marc Pichler 859c0ef5a0
ci: use codecov token when uploading reports (#5053) 2024-10-09 08:04:17 +00:00
Marc Pichler b057c93c15 [next] merge changes from main 2024-10-08 14:06:44 +02:00
Marc Pichler 8fed1b1b66
feat(sdk-metrics)!: drop View and Aggregation for options (#4931) 2024-10-08 13:46:31 +02:00
Marc Pichler 6ccd4df33a
docs: use npm ci in CONTRIBUTING.md (#5040) 2024-10-07 20:02:54 +00:00
David Luna 4947c2d6a4
chore(exporter-zipkin): remove usages of Span constructor (#5030)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-04 08:42:35 +00:00
Daniel Dyla 776993f0fc
feat(instrumentation-http): emit semconv 1.27 metrics (#5026) 2024-10-04 08:35:04 +00:00
David Luna 7baa493f50
test(instr-http): remove usages of `new Span` (#5035) 2024-10-04 08:00:03 +00:00
Richard Chukwu e0e2b4ad81
fix(sdk-node): use warn instead of error on unknown OTEL_NODE_RESOURCE_DETECTORS values (#5034)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-10-03 14:53:13 +00:00
Marc Pichler 3007d3e749
feat(exporters)!: rewrite exporter config logic (#4971) 2024-09-30 09:33:17 +00:00
Mend Renovate 77f12c57bf
chore(deps): lock file maintenance (#5027) 2024-09-30 07:44:38 +00:00
Rajat Khanna 98143af5db
fix(sdk-trace): make activeSpanProcessor private (#4965)
Co-authored-by: David Luna <david.luna@elastic.co>
2024-09-27 15:55:36 +02:00
David Luna d1cd7f23d0
refactor(instrumentation-http): replace `SpanAttributes` and `MetricAttributes` with `Attributes` (#5023) 2024-09-27 10:57:58 +00:00
David Luna 466140bdf8
refactor(sdk-metrics): replace `MetricsAttributes` with `Attributes` (#5021) 2024-09-27 07:42:21 +00:00
Mend Renovate 2f919a43fd
chore(deps): update dependency @types/jquery to v3.5.31 (#5018) 2024-09-26 14:46:13 +00:00
Richard Versteeg a5dade5462
fix(opentelemetry-core): confusing log extract of composite propagator (#5017) 2024-09-26 14:00:40 +00:00
David Luna 91c67ba470
refactor(resources)!: replace ResourceAttributes with Attributes (#5016) 2024-09-26 09:54:50 +02:00
David Luna e15d5b3bcd
feat(sdk-trace-base): replace SpanAttributes with Attributes (#5009) 2024-09-25 17:32:55 +02:00
Marc Pichler 9de31518e7
fix(events,logs): drop outdated API from devDependencies and align types (#5013) 2024-09-25 14:32:43 +00:00
Mend Renovate 2a4919c1cf
chore(deps): update dependency @types/mocha to v10.0.8 (#4986) 2024-09-24 09:46:21 +00:00
Daniel Dyla 395010f96b
Http server semconv span stable (#4978)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-09-24 08:29:08 +00:00
Mend Renovate ee40d5d9b7
chore(deps): update dependency chromedriver to v129 (#5007) 2024-09-24 08:28:26 +00:00
Mend Renovate 1ce52050bd
fix(deps): update dependency express to v4.20.0 [security] (#4989) 2024-09-24 08:27:26 +00:00
Jonathan Lee 5627d8451e
fix(sdk-metrics): Add missing catch and handle error in promise of `PeriodicExportingMetricReader` (#5006) 2024-09-24 08:26:39 +00:00
Mend Renovate 4574bf51c0
chore(deps): lock file maintenance (#5008) 2024-09-23 16:28:24 +00:00
Marc Pichler 42be951958
chore: remove --openssl-legacy-provider option (#5012) 2024-09-23 15:44:49 +00:00
Marc Pichler 8900cfdbba
fix(sdk-trace-base): avoid keeping non-string status.message on Span#setStatus() (#4999) 2024-09-23 15:44:37 +00:00
Marc Pichler 1804925c53
Merge pull request #5010 from dynatrace-oss-contrib/next-main-2024-09-23
[next] merge changes from main
2024-09-23 16:42:41 +02:00
Marc Pichler 32564adbb0 [next] merge changes from main 2024-09-23 16:33:59 +02:00
Marc Pichler f4d0dcf45d Merge branch 'main' into next-main-2024-09-23 2024-09-23 16:27:31 +02:00
Marc Pichler 4ef739580f
ci: switch to codecov action (#5011) 2024-09-23 14:16:02 +00:00
David Luna 6515ed8098
refactor(sdk-logs): replace ResourceAtrributes with Attributes (#5005)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-09-20 11:54:22 +00:00
David Luna 0571e429b6
refactor(browser-detector): replace `ResourceAtrributes` with `Attributes` (#5004) 2024-09-20 11:14:34 +00:00
Mend Renovate cdfefb8294
chore(deps): lock file maintenance (#4995) 2024-09-18 11:56:31 +00:00
David Luna 32e25c31c2
refactor(exporter-prometheus): replace MetricAttributes to Attributes (#4993) 2024-09-17 19:33:01 +00:00
Mend Renovate 92b0c368e8
chore(deps): update dependency babel-loader to v8.4.1 (#4996) 2024-09-17 12:55:43 +00:00
David Luna af0ecacf72
chore(deps): bump @opentelemetry/api dependency to 1.3.0 (#4992)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-09-17 08:13:13 +00:00
Martin Kuba e9eb92476e
feat(web): add processors for adding session ID (#4972)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-09-16 22:25:41 +00:00
Mend Renovate 9c30124e76
fix(deps): update dependency body-parser to v1.20.3 [security] (#4988) 2024-09-11 08:42:54 +00:00
Daniel Dyla f8ab5592dd
Update HTTP client span semconv to 1.27 (#4940)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-09-10 13:44:26 +00:00
sjvans 61c37441f5
fix: default compression to 'none' (#4985) 2024-09-10 13:13:55 +00:00
Hector Hernandez f7dc8ff5fa
feat(api-logs): Add delegating no-op logger provider (#4861) 2024-09-09 21:57:11 +00:00
Mend Renovate 016c240613
chore(deps): lock file maintenance (#4984) 2024-09-09 08:40:25 +00:00
Mend Renovate b78fec3406
fix(deps): update dependency axios to v1.7.4 [security] (#4970) 2024-09-04 16:33:41 +00:00
Mend Renovate 3d43356782
chore(deps): update dependency @types/mocha to v10.0.7 (#4974) 2024-09-04 15:39:44 +00:00
Justin Siebert a3983faa44
fix(jaeger-remote-sampler): Catch errors retrieving remote config (#4976) 2024-09-04 15:17:32 +00:00
Trent Mick 9d474e3b96
chore: unpin unit-test from 22.6 (#4977) 2024-09-04 15:17:07 +00:00
Mend Renovate 1fc304c1e9
chore(deps): lock file maintenance (#4968) 2024-09-02 14:13:15 +00:00
Mend Renovate a00a429b2c
chore(deps): update dependency chromedriver to v128.0.1 (#4967) 2024-09-02 11:11:12 +00:00
Mend Renovate e311672daf
chore(deps): update all patch versions (#4942) 2024-08-28 15:32:02 +00:00
Mend Renovate 7b800e124d
chore(deps): update dependency glob to v11 (#4955) 2024-08-28 13:15:12 +00:00
Marc Pichler d7f4288919
chore(deps): update dependency webpack to v5.94.0 (#4961)
Co-authored-by: Mend Renovate <bot@renovateapp.com>
2024-08-28 13:03:24 +00:00
Mend Renovate 41c0d88710
chore(deps): update dependency chromedriver to v128 (#4954)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-08-28 12:46:08 +00:00
OpenTelemetry Bot 720bc8c70d
chore: prepare next release (#4960)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-08-28 09:00:27 +00:00
OpenTelemetry Bot 65cedf71bd
chore: prepare next release (#4949) 2024-08-28 08:47:02 +00:00
Marc Pichler bd25230eae
docs: document console exporter output stability (#4956)
Co-authored-by: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com>
2024-08-28 07:11:10 +00:00
Jamie Danielson 948496dcbf
chore: pin unit test to node 22.6 until 22.8 is available (#4957) 2024-08-27 21:01:31 +00:00
Jamie Danielson 966ac176af
docs: Describe support for ESM (#4876)
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-08-27 08:01:52 +00:00
Trent Mick 2ca2459414
test(exporter-logs-otlp-grpc): improve error reporting in particular test failure (#4953) 2024-08-26 11:35:42 +00:00
Rajat Khanna c398601cc1
feat(jaeger-remote-sampler): Implement jaeger remote sampler (#4589)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-08-23 09:36:51 +00:00
OpenTelemetry Bot 3cf1c5215f
chore: prepare next release (#4939) 2024-08-22 15:19:43 +00:00
Marc Pichler 5578a11dfd
chore: sync package-lock.json (#4947) 2024-08-22 13:52:20 +00:00
Daniel 5c1ae0aa5b
docs(sdk-metrics): Update Histogram docs to reflect upper bound inclusivity (#4829)
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
2024-08-22 09:14:14 +00:00
Chengzhong Wu 0b8d310cf5
fix(sdk-metrics): use inclusive upper bounds in histogram (#4935)
Co-authored-by: Daniel Patrick <github@danielpatrick.dev>
2024-08-22 09:12:59 +00:00
Trent Mick 0ee398d1e3
fix(instrumentation): ensure .setConfig() results in config.enabled defaulting to true (#4941) 2024-08-22 09:12:34 +00:00
Marc Pichler f7dccbf0a0
Merge pull request #4934 from dynatrace-oss-contrib/next-main-2024-08-21
[next] merge changes from main
2024-08-22 09:51:08 +02:00
Trent Mick 7aff06d793
chore(release): script to align workspace on new semconv package version (#4937) 2024-08-21 17:44:06 +00:00
Marc Pichler 00683ff515 Merge branch 'main' into next-main-2024-08-21 2024-08-21 12:51:01 +02:00
Marc Pichler f2a6bcc204
feat(otlp-exporter-base)!: use transport interface in web exporters (#4895) 2024-08-21 10:35:49 +00:00
Marc Pichler cd4e2bf8c0
fix(otlp-exporter-base): fix handling of destroyed requests (#4929) 2024-08-21 09:30:30 +00:00
Jamie Danielson 583154c919
chore(semconv): Separate SemConv releases to allow different versioning (#4904)
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-08-20 21:29:59 +00:00
MartenH 14d086a234
feat(sdk-node)!: Automatically configure logs exporter (#4740) 2024-08-19 23:26:41 +00:00
Mend Renovate e1522f0f39
chore(deps): update all patch versions (#4923) 2024-08-19 09:23:33 +00:00
Mend Renovate 39ab59d9ad
chore(deps): lock file maintenance (#4927) 2024-08-19 08:03:02 +00:00
Trent Mick fb4619bfc8
fix(instrumentation): drop diag.debug on InstrumentationBase#init not returning any modules (#4925) 2024-08-19 08:02:42 +00:00
Alec Mev bb67268e17
fix(instrumentation): Fix optional property types (#4833) 2024-08-15 20:44:39 +00:00
Mend Renovate f047db9da2
chore(deps): lock file maintenance (#4912) 2024-08-13 15:20:16 +00:00
Mend Renovate 15e6534451
chore(deps): update dependency semver to v7.6.3 (#4916) 2024-08-13 14:58:30 +00:00
Mend Renovate af1efea55c
chore(deps): update dependency mocha to v10.7.3 (#4914) 2024-08-13 14:21:12 +00:00
Mend Renovate fbd28f0332
chore(deps): update babel monorepo (#4913) 2024-08-13 13:14:29 +00:00
Mend Renovate c0e25aaaf5
chore(deps): update dependency superagent to v10 (#4911) 2024-08-13 13:02:18 +00:00
Mend Renovate f947278cb3
chore(deps): update dependency chromedriver to v127.0.2 (#4909) 2024-08-13 12:38:39 +00:00
Mend Renovate 30d1e13876
chore(deps): update dependency chromedriver to v127.0.2 (#4892) 2024-08-12 08:49:34 +00:00
Marc Pichler d4b75c3f0c
docs(api): add `@since` annotations to all types (#4906) 2024-08-12 07:28:21 +00:00
Marc Pichler 3c307994fa
deps(sdk-metrics): remove unused lodash.merge dependency (#4905) 2024-08-09 21:02:30 +00:00
Amir Blum ae25ae3319
fix(api-logs): align AnyValue to spec (#4893) 2024-08-09 19:14:30 +00:00
Robb Kidd cf8edbed43
refactor: remove "export *" in favor of explicit named exports (#4880)
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-08-09 10:42:38 +00:00
Marc Pichler 5cc3dc28d7
fix(otlp-exporter-base)!: ensure we do not retry after the timeout has elapsed (#4889) 2024-08-09 07:34:32 +00:00
Daniel Dyla 01cea7caeb
Use weaver to generate latest semconv 1.27 (#4690)
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2024-08-07 12:45:34 +00:00
Daniel Dyla 38f6689480
Sync package-lock.json (#4900) 2024-08-02 14:29:54 +00:00
Marc Pichler b2778e1b2f
feat: add release PR workflow (#4849)
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-08-01 09:14:46 +00:00
Marc Pichler 30a46ae547
feat(exporter-*-otlp-*)!: remove some environment variable code from browser exporters (#4886) 2024-07-31 08:36:28 +00:00
Marc Pichler bb9caaf1ef
Merge pull request #4887 from dynatrace-oss-contrib/next-main-2024-07-30
[next] merge latest changes from `main`
2024-07-31 09:32:37 +02:00
Marc Pichler eee78fa2e7 chore: clean up merge 2024-07-30 16:05:29 +02:00
Marc Pichler 154155f7d9 Merge branch 'main' into next-main-2024-07-30 2024-07-30 15:22:29 +02:00
Mend Renovate 08942ba126
chore(deps): update dependency babel-plugin-istanbul to v7 (#4852) 2024-07-30 08:02:49 +00:00
Francesco Novy 1cf1939641
feat(otlp-transformer): Do not limit `@opentelemetry/api` upper range peerDependency (#4816)
* feat: Do not limit `@opentelemetry/api` upper range peerDependency

* Revert "feat: Do not limit `@opentelemetry/api` upper range peerDependency"

This reverts commit d0dd3d577b.

* only unclamp otlp-transformer

* Add changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-07-30 07:50:33 +00:00
Mend Renovate 3d66bcbb9c
chore(deps): update dependency karma to v6.4.4 (#4885) 2024-07-30 07:47:42 +00:00
Trent Mick 3f2c707ade
fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values (#4879)
* fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values

When NodeSDK is configured with explicit 'resourceDetectors' or
with 'autoDetectResources: false', then it should not emit diag
errors about unknown values in OTEL_NODE_RESOURCE_DETECTORS.
This can happen when that envvar is used with
@opentelemetry/auto-instrumentation-node

Closes: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/2311

* add a changelog entry

* lint:fix
2024-07-30 07:47:22 +00:00
Marc Pichler d91dbe1b1d
feat(exporters)!: use transport interface in node.js exporters (#4743)
* feat(exporters)!: use transport interface in node.js exporters

* feat(exporters): hide compression property

* feat(otlp-exporter-base)!: remove header property

* feat(otlp-exporter-base): add retrying transport

* fix: lint

* chore: add changelog entry

* fix: use queueMicrotask over nextTick

* chore: move changelog entry to unreleased

* chore: note that user-agent cannot be overwritten by users anymore

* fix: export missing ExportResponseRetryable

* fix: retry jitter
2024-07-29 14:54:01 +00:00
Mend Renovate 3460a8c264
chore(deps): update dependency chromedriver to v127 (#4883) 2024-07-29 14:46:50 +00:00
Mend Renovate f2039e856b
chore(deps): update all patch versions (#4860) 2024-07-29 14:37:10 +00:00
Francesco Novy 34003c9b7e
feat(http): Allow to opt-out of instrumenting incoming/outgoing requests (#4643)
* feat(http): Allow to opt-out of instrumenting incoming/outgoing requests

* fix tests

* PR feedback

* add a changelog entry

---------

Co-authored-by: Trent Mick <trentm@gmail.com>
2024-07-25 19:14:37 +00:00
Trent Mick d4035eb973
fix(instrumentation-http): Ensure instrumentation of `http.get` and `https.get` work when used in ESM code (#4866)
* fix(instrumentation-http): Ensure instrumentation of `http.get` and `https.get` work when used in ESM code

The issue was that the `_wrap`ing of `http.get` was getting the
just-wrapped `http.request` by accessing `moduleExports.request`.
However, when wrapping an ES module the `moduleExports` object from IITM
is a Proxy object that allows setting a property, but *not* re-getting
that set property.

The fix is to use the wrapped `http.request` from the `this._wrap` call.
That required fixing a bug in the IITM code-path of
`InstrumentationBase.prototype._wrap` to return the wrapped property.
(The previous code was doing `return Object.defineProperty(...)`, which
returns the moduleExports, not the defined property.)

Fixes: #4857

* correct typo in the changelog message

* does this fix the test:esm script running on windows?

* remove other console.logs (presumably dev leftovers) from tests in this file

* test name suggestion

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* test name suggestion

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* test name suggestion

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* test name suggestion

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* var naming suggestion: expand cres and creq, the abbrev isn't obvious

---------

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-07-24 05:08:41 +00:00
Luca Forstner a6020fb113
deps(opentelemetry-instrumentation): Bump shimmer types to 1.2.0 (#4865)
* deps(opentelemetry-instrumentation): Bump shimmer types to 1.2.0

* changelog
2024-07-17 21:40:04 +00:00
Amir Blum 8d88c36dcb
feat: include instrumentation scope info in console span and log record exporters (#4848)
* feat: print instrumentation library info with console span exporter

* chore: add changelog

* test: fix tests for console span exporter

* feat: instrumentation scope for both logs and spans

* chore: update changelog
2024-07-17 05:53:18 +00:00
Oliver Sand 54b14fbbe3
docs(opentelemtry-instrumentation): fix reversed jsdoc comment (#4855)
Signed-off-by: Oliver Sand <oliver@plancraft.de>
2024-07-09 21:16:23 +00:00
Johannes Huster 539d94265b
docs(opentelemetry-browser-detector): Use tree-shakeable string constants for semconv in Readme (#4768)
* docs(opentelemetry-browser-detector): Use tree-shakeable string constants for semconv in Readme

* Update changelog

* Uninstall unused semantic-conventions package from browser-detector package

* Move changelog entry to Unreleased section

* rm changelog entry, I don't think it is necessary for a small docs update

---------

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
2024-07-05 22:00:32 +00:00
Amir Blum 0f6363ae35
fix(instrumentation)!:remove unused description property from interface (#4847)
* fix(instrumentation):remove unused description property from instrumentation ifc

* chore: changelog
2024-07-04 08:57:55 +00:00
Marc Pichler a037f84b67
chore: drop ts-mocha for mocha and ts-node (#4840)
* chore: drop ts-mocha for mocha and ts-node

* fixup! chore: drop ts-mocha for mocha and ts-node
2024-07-03 14:49:36 +00:00
Mend Renovate fbb1b360eb
fix(deps): update all patch versions (#4822) 2024-07-01 18:47:39 +00:00
Marc Pichler 01a2c35a69
chore: add @JamieDanielson to maintainers (#4824) 2024-06-26 12:13:58 +00:00
Marc Pichler f99e7d9c2c
chore: add @maryliag to triagers (#4821)
* chore: add @maryliag to triagers

* chore: alphabetically order approvers

* chore: it's grafana labs, not grafana
2024-06-25 14:44:48 +00:00
Daniel Starns 3fdadd516e
refactor: reduce and simplify usage of getEnv() (#4799)
* refactor: reduce and simplify usage of getEnv()

* docs: update CHANGELOG

* fixup! docs: update CHANGELOG

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-25 07:43:19 +00:00
Mend Renovate 73fad98428
chore(deps): update all patch versions (#4819) 2024-06-24 14:39:23 +00:00
Marc Pichler 08628bce82
chore: add @trentm to maintainers (#4813) 2024-06-24 10:12:57 +00:00
Marc Pichler 86019e0ff6
feat: add release-pr update chores as scripts to package.json (#4793)
* feat: add release-pr update chores as scripts to package.json

* fix: use all instead of api

* docs: update usage comment for extract-latest-release-node.js
2024-06-21 09:07:36 +00:00
Marc Pichler 0608f40557
chore: prepare release 1.25.1/0.52.1 (#4809)
* chore: prepare release 1.25.1/0.52.1

* Update experimental/CHANGELOG.md
2024-06-20 08:25:48 +00:00
Tim Fish cdd5284dc3
feat(instrumentation): Use a caret version for `import-in-the-middle` dependency (#4810)
* feat(instrumentation): Use a caret version for `import-in-the-middle`

* update changelog
2024-06-19 15:58:44 +00:00
Mend Renovate 81f78a6e42
chore(deps): update dependency chromedriver to v126 (#4800) 2024-06-19 11:35:18 +00:00
Mend Renovate 1041ed4fdb
chore(deps): lock file maintenance (#4801) 2024-06-19 11:34:59 +00:00
Tim Fish c07aa537cb
fix: Update `import-in-the-middle` (#4806)
* fix: Update `import-in-the-middle`

* add changelog entry

* linting is important
2024-06-19 09:02:52 +00:00
Marc Pichler 55f15e90d6
feat(sdk-metrics)!: replace attributeKeys with an option to add custom processors (#4532) 2024-06-18 16:17:36 +02:00
Daniel Starns 3cbc9c72e9
docs: add SimpleSpanProcessor warning (#4798)
* docs: add SimpleSpanProcessor warning

* Update packages/opentelemetry-sdk-trace-base/src/export/SimpleSpanProcessor.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-18 11:50:44 +00:00
Michał Lipiński 9e421f6a84
docs(exporter-logs-otlp-http): change OTLPLogsExporter to OTLPLogExporter (#4790) 2024-06-18 09:28:13 +00:00
Daniel Starns dd83751f19
docs: change to SEMRESATTRS_SERVICE_NAME (#4797) 2024-06-18 09:23:34 +00:00
Kaung Zin Hein 4fa7c1358e
refactor(examples/opentelemetry-web): use new exported string constants for semconv (#4764)
* refactor(examples/opentelemetry-web): use new exported string constants for semconv

* added changelog entry

* deleted changelog extra line

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-14 07:55:20 +00:00
Marc Pichler 812c774998
refactor(context-zone-peer-dep): use explicit exports (#4787)
* refactor(context-zone-peer-dep): use explicit exports

* chore: changelog
2024-06-13 07:40:03 +00:00
Marc Pichler 48854685d3
refactor(context-async-hooks): use explicit exports (#4786)
* refactor(context-async-hooks): use explicit exports

* chore: add changelog entry
2024-06-12 18:49:08 +00:00
Marc Pichler b5409d7acd
refactor(otlp-transformer): use explicit exports (#4785)
* refactor(otlp-transformer): use explicit exports

* chore: add changelog entry

* Update experimental/CHANGELOG.md

* Update experimental/CHANGELOG.md
2024-06-12 18:48:44 +00:00
Mend Renovate c280a08027
fix(deps): update dependency @grpc/grpc-js to v1.10.9 [security] (#4782) 2024-06-11 12:32:51 +00:00
Marc Pichler 05e2699089
fix(sdk-node): register context manager if no tracer options are provided (#4781)
* fix(sdk-node): register context manager if no tracer options are provided

* chore: add changelog entry
2024-06-11 07:25:06 +00:00
Mend Renovate c9ea5f2428
chore(deps): lock file maintenance (#4780) 2024-06-10 12:04:15 +00:00
Trent Mick 01664ddf87
tests: regenerate recently-expired test TLS certs (#4777)
* tests: regenerate recently-expired test TLS certs

Tests started failing yesterday because the various TLS certs in
the repo used for TLS testing had expired

$ openssl x509 -noout -enddate -in experimental/packages/exporter-logs-otlp-grpc/test/certs/ca.crt
notAfter=Jun  7 16:44:23 2024 GMT

This change regenerates all the TLS certs used for testing and
examples/https. It also adds a test case in each relevant package
that will fail with an obvious message when these certs expire
next time (certs are generated with a 1y expiry).

This also adds a comment 'npm run main:regenerate-test-certs'
that can be used to run the maintenance task.

* lint:fix, add changelog entry

* skip cert expiry test on node v14, because crypto.X509Certificate came in node v15
2024-06-10 10:54:49 +00:00
mmouru 2e42181ff0
refactor(instr-fetch): move fetch to use SEMATRR (#4632)
* refactor(instr-fetch): move fetch to use SEMATRR

* Update experimental/CHANGELOG.md

Co-authored-by: Trent Mick <trentm@gmail.com>

* Apply suggestions from code review

update readme table to use attribute strings

* move changelog entry to unreleased

---------

Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-06-08 00:15:51 +00:00
Marc Pichler fd911fb3a4
chore: move haddasbronfman from approver to emeritus (#4765)
* chore: move haddasbronfman from approver to emeritus

* fixup! chore: move haddasbronfman from approver to emeritus
2024-06-07 09:25:04 +00:00
Johannes Huster bd053932b7
refactor(sdk-node): Use tree-shakeable string constants for semconv (#4767)
* refactor(sdk-node): Use tree-shakeable string constants for semconv

* Update changelog
2024-06-07 08:32:03 +00:00
Mend Renovate 6481396a6b
chore(deps): update all patch versions to v7.24.7 (#4772) 2024-06-06 07:52:15 +00:00
Marc Pichler 6bb2f16d85
chore: add @david-luna to approvers (#4766) 2024-06-05 17:28:14 +00:00
Marc Pichler c4d3351b6b
fix(sdk-logs): adapt versions for release (#4769)
* chore(sdk-logs): fixup release PR versions

* fixup! chore(sdk-logs): fixup release PR versions
2024-06-05 15:30:17 +00:00
Marc Pichler 26974c4d07
chore: prepare release API 1.9.0/Core 1.25.0/Experimental 0.52.0 (#4677)
* chore: prepare release

* fixup! chore: prepare release

* chore: sync package-lock.json
2024-06-05 14:51:53 +00:00
Kaung Zin Hein 957fa3b5e4
refactor(examples/esm-http-ts): use new exported string constants for semconv (#4758)
* refactor(examples/ems-http-ts): use new exported string constants for semconv

* added changelog entry

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-05 12:48:25 +00:00
Kaung Zin Hein 97d0ec5a1b
refactor(examples/basic-tracer-node): use new exported string constants for semconv (#4759)
* refactor(examples/basic-tracer-node): use new exported string constants for semconv

* updated semconv pacakge ^1.22.0

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-05 08:25:44 +00:00
Kaung Zin Hein 929e345454
refactor(examples/grpc-js): use new exported string constants for semconv (#4760)
* refactor(examples/grpc-js): use new exported string constants for semconv

* updated semconv package ^1.22.0

* added changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-05 08:15:37 +00:00
Kaung Zin Hein 97f372b475
refactor(experimental/examples/opencensus-shim): use new exported string constants for semconv (#4763)
* refactor(experimental/examples/opencensus-shim): use new exported string constants for semconv

* added changelog entry (experimental)
2024-06-05 08:13:39 +00:00
Kaung Zin Hein 9cd2021119
refactor(examples/otlp-exporter-node): use new exported string constants for semconv (#4762)
* refactor(examples/otlp-exporter-node): use new exported string constants for semconv

* added changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-05 08:09:52 +00:00
Kaung Zin Hein de503497b9
refactor(examples/opentracing-shim): use new exported string constants for semconv (#4761)
* refactor(examples/opentracing-shim): use new exported string constants for semconv

* updated semconv to ^1.22.0

* added changelog entry
2024-06-05 08:06:16 +00:00
Martin Kuba 7c808e3117
add Events SDK (#4629)
* feat(sdk-events): add Events SDK

* updated changelog

* markdown lint

* updated changelog with changes to the events API

* added missing implements

* set defaults for severityNumber and timestamp

* added OTLP exporter to example

* updated package-lock.json

* updated versions

* pinned api-logs and api-events versions

* removed getting global LoggerProvider

* updated example version

* removed unnecessary constant

* lint

* updated events example

* pinned api-logs version for logs sdk

* updated package-lock

* removed unused configuration

* added forceFlush and shutdown to EventLoggerProvider

* updated package-lock.json

* updated tsconfig files

* fixed package-lock.json

* removed shutdown method, updated example

* cleanup

* added domain to examples

* updated versions

* fix browser tests
2024-06-05 07:59:05 +00:00
Gerhard Stöbich 9d3bc18f7d
chore: move flarna from approver to emeritus (#4757) 2024-06-05 07:36:53 +00:00
Tim Fish 106fa9bfdd
fix: Update `import-in-the-middle` (#4745)
* fix: Update `import-in-the-middle`

* changelog and lint

* lint

* changes from code review

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-05 07:32:53 +00:00
Prashansa Kulshrestha 315239da67
refactor(instrumentation-xhr): use exported strings for semantic attr… (#4681)
* refactor(instrumentation-xhr): use exported strings for semantic attributes

Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>

* Updated changelog entry with PR id and link

Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>

* Changed normal string to template string and replaced old HTTP_RESPONSE_CONTENT_SIZE to new exported string

Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>

---------

Signed-off-by: Prashansa Kulshrestha <prashkulshrestha@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-04 08:24:09 +00:00
Jamie Danielson be9d11c045
chore(resources): update deprecated semconv to use exported strings (#4755)
* chose(resources): update deprecated semconv to use exported strings

* update test to match changes in contrib 2210

* prep changelog

* update changelog

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-04 08:21:38 +00:00
Jamie Danielson 1ef6027457
docs(instrumentation-http): cleanup readme semconv keys (#4754) 2024-06-04 08:18:36 +00:00
Jamie Danielson c66b65f610
chore(exporters): updated deprecated semconv to use exported strings (#4756)
* chore(exporter-zipkin) update deprecated semconv to use exported strings

* chore(exporter-jaeger) update deprecated semconv to use exported strings

* chore(exporter-prometheus): update deprecated semconv to use exported strings

* add changelog

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-04 08:16:01 +00:00
Kaung Zin Hein 0ce7d94e3e
refactor(examples/https): use new exported string constants for semconv (#4753)
* refactor(examples/https): use new exported string constants for semconv

* refactor(examples/https): use new exported string constants for semconv in the https example
2024-06-04 07:37:22 +00:00
Kaung Zin Hein 20074d8cd3
refactor(examples/http): use new exported string constants for semconv (#4750)
* refactor(examples/http): use new exported string constants for semconv

* added changelog entry

* refactor(examples/http): actually use new exported string constants for semconv
2024-06-04 07:35:23 +00:00
Marc Pichler 95edbd9992
feat(instrumentation)!: simplify `registerInstrumentations()` API (#4675)
* feat(instrumentation)!: reduce complexity

* fixup! feat(instrumentation)!: reduce complexity

* fixup! fixup! feat(instrumentation)!: reduce complexity

* fixup! fixup! feat(instrumentation)!: reduce complexity

* fix: re-add accidenally dropped markdownlint-disable
2024-06-03 09:56:31 +00:00
Johannes Huster 55c6c014cf
refactor(shim-opentracing): Use tree-shakeable string constants for semconv (#4746)
* refactor(shim-opentracing): Use tree-shakeable string constants for semconv

* Update changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-03 09:48:11 +00:00
Mend Renovate 04dc781a84
chore(deps): update all patch versions (#4751) 2024-06-03 09:42:12 +00:00
Johannes Huster 81b847484e
refactor(sdk-trace-web): Use tree-shakeable string constants for semconv (#4747)
* refactor(sdk-trace-web): Use tree-shakeable string constants for semconv

* Update changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-03 09:41:33 +00:00
Johannes Huster 7e72f1cccf
refactor(sdk-trace-node): Use tree-shakeable string constants for semconv (#4748)
* refactor(sdk-trace-node): Use tree-shakeable string constants for semconv

* Update changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-06-03 09:39:15 +00:00
Johannes Huster ba7bdf5465
refactor(sdk-trace-base): Use tree-shakeable string constants for semconv (#4749)
* refactor(sdk-trace-base): Use tree-shakeable string constants for semconv

* Update changelog
2024-06-03 09:37:24 +00:00
Johannes Huster ecc88a38d8
refactor(core): Use (tree-shakeable) string constants for semconv (#4739)
* refactor(core): Use exported strings for semconv

* Update changelog
2024-05-31 10:02:05 +00:00
Marc Pichler 634277f460
fix(deps): remove protobufjs from grpc-base (otlp-transformer used instead), update protobufjs (security) (#4732) 2024-05-31 07:51:56 +00:00
Marc Pichler 82b7526b02
chore(deps): remove unused cpx dependencies and update used ones to cpx2 (#4510)
* chore(deps): remove unused cpx dependencies and update used ones to cpx2

* fix: sync package-lock, introduce timeout
2024-05-28 07:43:24 +00:00
Mend Renovate 7238852445
chore(deps): update all patch versions (#4734) 2024-05-28 07:41:27 +00:00
Samuel Cochrane 4f6d7a4ade
feat(context-zone*): support zone.js 0.12.x (#4736)
Signed-off-by: Samuel Cochrane <chopshoolihan@gmail.co>
2024-05-28 07:39:50 +00:00
Marc Pichler 969a16f911
chore(renovate): set releaseWhen to conflicted to improve merge-queue behavior (#4730) 2024-05-27 08:33:11 +00:00
Clinton Blackburn 095003da3e
feat(api): added synchronous gauge (#4528)
* feat(instrumentation): added synchronous gauge

* fixup! feat(instrumentation): added synchronous gauge

* fixup! feat(instrumentation): added synchronous gauge

* fixup! feat(instrumentation): added synchronous gauge
2024-05-27 08:30:47 +00:00
Mend Renovate 860e5d5746
chore(deps): update dependency @types/sinon to v17 (#4718) 2024-05-23 14:47:48 +00:00
Mend Renovate 182cbb530d
chore(deps): update dependency chromedriver to v125 (#4719) 2024-05-23 13:35:05 +00:00
Mend Renovate 195e5efb4e
chore(deps): update dependency @types/superagent to v8 (#4679) 2024-05-23 13:11:33 +00:00
Mend Renovate d545521580
fix(deps): update all patch versions (#4390) 2024-05-23 13:10:31 +00:00
Marc Pichler c97f21f221
Revert "feat(sdk-trace-node): support xray propagator (#4602)" (#4727)
* Revert "feat(sdk-trace-node): support xray propagator (#4602)"

This reverts commit 75d88f7126.

* chore: sync package-lock.json
2024-05-23 10:33:35 +02:00
Pierre Bertrand 4e778b1257
docs: fix instrumentation-graphql package name in documentation (#4723) 2024-05-22 08:38:32 -07:00
Trent Mick 2d867172b4
docs: fix code example in README (#4726) 2024-05-22 17:26:07 +02:00
Trent Mick e49c4c7f42
chore(lint): refactor Markdown linting to use markdownlint-cli2 (#4713)
* chore(lint): refactor Markdown linting to use markdownlint-cli2

- first commit is just config changes; lint updates will follow

* lint fixes

* fix markdownlint for rule MD045/no-alt-text

* lint config changes for prefering 'dash' style for rule MD004/ul-style

* lint:markdown:fix changes for MD004/ul-style

* manually apply this h3->h2 fix that Amir had in his #4703 PR

* mention markdown linting in the Linting section of the contributor guide

* add link to rules docs

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-21 14:44:23 +02:00
Marc Pichler bac68fc7d4
feat: add api release preparation scripts, github release creation scripts (#4704)
* feat: add more scripts for release creation

* Update scripts/extract-latest-release-notes.js

* fix: replace console.log() with console.warn(), ensure get-version.js is a version by checking against a regex

* chore: add comment to describe the regex
2024-05-21 14:36:43 +02:00
Amir Blum d7fcc77d55
docs: enhanced description for instrumentations in package.json (#4715)
* docs: enhanced description for instrumentations in package.json

* chore: CHANGELOG

* fix: do not export description from core package

* fix: revert unrelated change

* fix: remove CHANGELOG entry and fix text
2024-05-21 14:34:47 +02:00
Amir Blum 20182d8804
chore: fix personal info in README (#4714) 2024-05-17 11:04:14 +02:00
Amir Blum 4c01b33826
feat(instrumentation): remove default value for config in base instrumentation constructor (#4695)
* fix(instrumentation)make config object required in base instrumentation

* chore: CHANGELOG

* fix: constructor pattern for instrumentations

* chore: lint fix

* Update experimental/CHANGELOG.md

* Update experimental/CHANGELOG.md

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* Update CHANGELOG.md

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-17 10:19:57 +02:00
Mend Renovate 806fa97ebd
chore(deps): update dependency ts-loader to v9 (#4707) 2024-05-15 17:18:14 +02:00
Marc Pichler a479ddce4b
chore: update versions to 1.24.1/0.51.1, carry over changelog adjustments (#4705)
* fix(resources): prevent circular import (resource -> detector -> resource -> ...) (#4653)

* fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fixup! fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used (#4649)

* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md

* fix(deps): update dependency import-in-the-middle to v1.7.4 (#4667)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base depen… (#4678)

* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: sync package-lock.json, adapt changelog

* chore: prepare release 1.24.1/0.51.1

* chore: adjust changelog

* chore: sync package-lock.json

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Aksel Allas <allasaksel@gmail.com>
2024-05-15 10:19:42 +02:00
Mend Renovate 3c8c29ac8f
chore(deps): lock file maintenance (#4700) 2024-05-13 16:17:48 -04:00
Amir Blum 50bd46061e
docs(instrumentation): better docs for supportedVersions option (#4693)
* docs(instrumentation): better docs for supportedVersions option

* docs: add recomundation to bound major version

* revert: Instrumentation class changes

* docs: add recommendation in both places

* docs: lint fix

* chore: CHANGLOG

* Update experimental/packages/opentelemetry-instrumentation/src/types.ts

* Update experimental/packages/opentelemetry-instrumentation/src/types.ts

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-13 11:21:47 +02:00
Amir Blum 1c6e8b2531
fix(instrumentation)!: remove unused supportedVersions from Instrumentation interface (#4694)
* chore: CHANGLOG

* fix(instrumentation): remove unused property from instrumentations

* chore: CHANGELOG

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-13 11:10:57 +02:00
Amir Blum 15b35260df
docs: align all supported versions to a common format (#4696)
* docs: align all supported versions to a common format

* chore: CHANGELOG

* docs: make markdown list

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-13 11:08:38 +02:00
Marc Pichler 3ca2f5ba8d
chore(renovate): remove import-in-the-middle from the all-patch ignore list (#4684) 2024-05-13 11:04:19 +02:00
Amir Blum 3cfa78303a
feat(instrumentation): apply unwrap before wrap in base class (#4692)
* feat(instrumentation): apply unwrap before wrap in base class

* chore: CHANGELOG
2024-05-13 10:55:51 +02:00
Chengzhong Wu 4777631b13
chore: remove obsolete submodules (#4688) 2024-05-11 08:22:12 -04:00
Chengzhong Wu ca027b5eed
doc: update legendecas affiliation (#4686) 2024-05-08 19:02:34 +02:00
Mend Renovate 5608bba359
chore(deps): lock file maintenance (#4680) 2024-05-06 13:57:45 +02:00
Amir Blum 46d79f9a5e
feat(instrumentation): add util to execute span customization hook in base class (#4663)
* feat(instrumentation): hoist span event hook execution to base class

* test: add test for new hook runner

* chore: changelog

* fix: use event name from arguments

* fix: remove unused import

* fix: make diag message structual

* make the private function start with underscore

* chore: rename insetrumentation event to span customization hook

* chore: update changelog

* chore: lint fix

* Update experimental/packages/opentelemetry-instrumentation/src/instrumentation.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: move CHANGELOG to experimental

* fix: changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-06 12:57:55 +02:00
Aksel Allas a82d875863
fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base depen… (#4678)
* fix(exporter-metrics-otlp-grpc) Add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc

* Update CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-06 10:34:17 +02:00
Siim Kallas c503ff1394
feat: allow adding links after span creation (#4536)
* feat: allow adding links after span creation

* update changelog

* improve docs

* test: increase coverage

* Update api/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* update changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-06 10:27:34 +02:00
Marc Pichler 1c5de7ac2f
feat!: use serializers in browser exporters (#4581)
* feat!: use serializer in browser exporters

* feat!: remove unused convert

* fixup! feat!: use serializer in browser exporters

* chore: update changleog
2024-05-03 18:25:37 +02:00
Anuraag Sridhar 75d88f7126
feat(sdk-trace-node): support xray propagator (#4602)
* fix(opentelemetry-sdk-trace-node): support xray propagator

Signed-off-by: Anu Sridhar <anu.sridhar@nearmap.com>

* linter fix

Signed-off-by: Anu Sridhar <anu.sridhar@nearmap.com>

* Build trigger

* Update package.json

Revert newline change

* chore: add changelog entry

* fix: lint

---------

Signed-off-by: Anu Sridhar <anu.sridhar@nearmap.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-03 15:03:16 +02:00
Martin Kuba b518e16ef8
add AWS X-Ray Lambda propagator (#4554)
* updates tsconfig files

* added tests

* added aws-xray-lambda propagator

* updated README

* updated package-lock file

* markdown lint

* removed browser tests

* lint

* removed opentelemetry- from the package name

* updated package-lock.json

* add experimental disclaimer

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* removed profiling from keywords

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* updated package version to experimental

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* use named export

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* removed changelog

* updated homepage url

* small updates to tests

* lint

* updated changelog

* Update experimental/packages/propagator-aws-xray-lambda/test/AWSXRayLambdaPropagator.test.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* updated tsconfig files

* updated license

* updated readme

* updated versions

* fix: update versions and sync package-lock.json

* fix: move changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-05-03 13:00:35 +02:00
Marc Pichler 9400e726d0
chore: update karma-webpack to v5.0.1, adapt tests (#4648)
* chore(deps): update dependency karma-webpack to v5

* feat: add polyfills missing from webpack 5, adapt tests, split up raw env parsing into browser/node specific code

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
2024-05-02 10:39:04 +02:00
Amir Blum 157c811274
feat(instrumentation): generic config type in instrumentation base (#4659)
* feat!(instrumentation): generic config type and no default config value

* fix: apply type in base Instrumentation interface

* revert: enabled flag rename

* fix: autoloader types

* chore: lint fix

* revert: default config in constructor to empty object

* revert: make constructor config default empty object

* docs: note that instrumentation config fields are optional

* revert: deftaul type for generic

* revert: default object in instrumentation abstract constructor

* chore: lint fix

* chore: changelog

* fix: changelog in merge
2024-05-02 08:21:18 +03:00
Mend Renovate 753f0a63a2
fix(deps): update dependency import-in-the-middle to v1.7.4 (#4667) 2024-04-30 20:03:36 +02:00
Daniel Dyla 5c84971528
Add node 22 support (#4666)
* Test node 22

* Update changelog and readme
2024-04-30 09:52:04 +02:00
Mend Renovate e86470a53b
chore(deps): update dependency superagent to v9 (#4665)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-29 13:52:50 +02:00
Mend Renovate 4d6cf080c7
chore(deps): update dependency chromedriver to v124 (#4664) 2024-04-29 13:45:32 +02:00
Mend Renovate d99e211a31
chore(deps): lock file maintenance (#4652) 2024-04-26 17:26:27 +02:00
Harel Moshe e44895fdac
feat(sdk-logs): emit resource attributes from ConsoleLogRecordExporter (#4646)
* feat(sdk-logs): emit resource attributes from ConsoleLogRecordExporter

* Update CHANGELOG

* Fix test

* Update experimental CHANGELOG

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-26 17:02:51 +02:00
Marc Pichler 8c12dd5c42
feat!: move serialization to `@opentelemetry/otlp-transformer` (#4542)
* feat!:move serializers to otlp-transformer

* feat!: use serializeres in protobuf and json exporters

* test(otlp-transformer): add tests for trace serializer

* test(otlp-transformer): add tests for metrics serializer

* test(otlp-transformer): add tests for logs serializer

* chore: resolve more conflicts

* fix: sync package-lock

* chore: cleanup dependencies, unused code, .gitignore

* chore: fix changelog indentation

* fix(otlp-transformer): remove unused useHex from JsonMetricsSerializer

* chore: add comment about how logs data is structured

* docs: move submodule.md, adapt contents

* fixup! Merge branch 'main' into feat/transformer-serializer

* fixup! Merge branch 'main' into feat/transformer-serializer
2024-04-26 16:11:38 +02:00
Marc Pichler 141b457b85
fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used (#4649)
* fix(core): align inconsistent behavior of getEnv() and getEnvWithoutDefaults() when a process polyfill is used

* Update CHANGELOG.md
2024-04-26 14:46:29 +02:00
Marc Pichler 8079fd6880
fix(resources): prevent circular import (resource -> detector -> resource -> ...) (#4653)
* fix(resources): prevent circular import (resource -> detector -> resource -> ...)

* fixup! fix(resources): prevent circular import (resource -> detector -> resource -> ...)
2024-04-26 14:22:31 +02:00
Marc Pichler 3ab4f765d8
chore: prepare release 1.24.0/0.51.0 (#4650) 2024-04-24 15:46:45 +02:00
Amir Blum 31eb60dc99
feat!(instrumentation): add patch and unpatch diag log messages (#4641)
* refactor(@opentelemetry/instrumentation): add patch and unpatch diag log messages

* chore: CHANGELOG

* fix: exclude version in core packages

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-19 13:26:12 +02:00
Amir Blum 99431df2e2
feat!(instrumentation): remove moduleExports generic type from instrumentation registration (#4598)
* feat!(instrumentation): remove moudleExports generic type from instrumentation registration

* fix: lint

* chore: add changelog

* fix: core instrumentations

* docs: update README with the change

* Update experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update experimental/packages/opentelemetry-instrumentation/src/platform/node/instrumentation.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: lint

* revert: sdk-logs in tsconfig

* chore: lint markdown

* Apply suggestions from code review

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* Update experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleFile.ts

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* Update experimental/packages/opentelemetry-instrumentation/src/instrumentationNodeModuleDefinition.ts

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* fix: remove unrelevant eslint ignore

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-04-19 13:03:39 +02:00
Marylia Gutierrez 73fddf9b5e
feat(sdk-node): add serviceInstanceIdDetector to NodeSDK (#4626)
* feat(sdk-node): add serviceInstanceIDDetector to NodeSDK

Follow up from #4608

Adds the resource detector ServiceInstanceIDDetector on the NodeSDK constructor.
It only gets added by default on any of those conditions:
- the value `serviceinstance` is part of the list `OTEL_NODE_RESOURCE_DETECTORS`
- `OTEL_NODE_EXPERIMENTAL_DEFAULT_SERVICE_INSTANCE_ID` is set to `true`

* remove OTEL_NODE_EXPERIMENTAL_DEFAULT_SERVICE_INSTANCE_ID

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>

* update readme on how to use `OTEL_NODE_RESOURCE_DETECTORS`

* feedback from review

* Update experimental/packages/opentelemetry-sdk-node/README.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* feedback from review

---------

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-17 15:50:13 +02:00
Mend Renovate 0d6c45697f
fix(deps): update dependency axios to v1.6.0 [security] (#4639) 2024-04-17 11:16:11 +02:00
Severin Neumann 26101229ae
fix: revert modifications to Apache license (#4640)
Signed-off-by: svrnm <neumanns@cisco.com>
2024-04-16 18:01:36 +02:00
Mend Renovate 629bb8398b
chore(deps): lock file maintenance (#4634) 2024-04-16 13:46:20 +02:00
mmouru 0a750eb90b
refactor(instr-grpc): move to use SEMATTRS (#4633)
* refactor(instr-grpc): move to use SEMATTRS

* Update experimental/CHANGELOG.md

* Update experimental/CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-16 11:31:15 +02:00
Martin Kuba 7f82b80f3c
Move xray propagator from contrib (no history) (#4603)
* moved aws xray propagator from contrib

* updated package lock file

* updated dev dependencies

* added a note about the original location in README

* updated changelog

* fix: limit package-lock.json changes

* removed status section from readme

* chore: align versions with current release

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-16 10:53:51 +02:00
Marc Pichler 87e25c5e01
fix: ensure api is not dropped from workspaces in package-lock.json (#4623) 2024-04-15 13:34:34 +02:00
Hyun Oh 3b5eb239cc
feat(sdk-logs): make dropping attribute print message (#4614)
* feat(sdk-logs): make dropping attribute print message

* chore: update changelog

* chore(sdk-logs): add comment to explain message logic

* Update experimental/CHANGELOG.md

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-15 13:13:45 +02:00
Tim Fish da02c8d6b1
fix: Don't use `require` to load `package.json` files (#4593)
* fix: Don't use require to load package.json files

* update changelog

* Move changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-15 13:12:55 +02:00
Marc Pichler fab27d578a
chore(renovate): enable lock file maintainance (#4628) 2024-04-15 10:32:28 +02:00
Marylia Gutierrez 583cc7c23d
feat(resources): implements `service.instance.id` (#4608)
* feat(node-sdk): implements `service.instance.id`

Implements `service.instance.id`

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>

* implement service instance id by default with env var

use an experimental environment variable to set the default value of `service.instance.id` as default

* Update CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* create separate add experimental for browser and node

create a function to add experimental default values (currently only service instance id, but others can be added in the future),
with the value being set on the node case, but not on the browser case.

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>

* use resource detector for service instance id

use a resource detector for service instance id

* remove references to env variables

* remove Detector and use DetectorSync

remove the Detector and use the DetectorSync instead. Also mark things as experimental.

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>

* Update packages/opentelemetry-resources/src/platform/node/ServiceInstanceIDDetectorSync.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* rename ServiceInstanceIDDetector to ServiceInstanceIDDetectorSync

* change ID to Id

* renaming something temp so git will pick up the name change

it was not picking up the case change on previous commit

* update to final name using Id

---------

Signed-off-by: maryliag <marylia.gutierrez@grafana.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-15 10:28:48 +02:00
Marc Pichler 34387774ca
fix(otlp-grpc-exporter-base): avoid TypeError on exporter shutdown (#4612)
* fix(otlp-grpc-exporter-base): avoid TypeError on exporter shutdown

* chore: update changelog

* fix: use gRPC Client type over any

* fixup! fix: use gRPC Client type over any

* fix: use ts-lint/ts-ignore
2024-04-11 15:48:27 +02:00
Trent Mick b067aed8ba
chore(instrumentation): remove accidental devDep on api-logs (#4627)
This package accidentally got a dep and devDep on api-logs, at
different versions. The result was it being pinned at the older
version in package-lock.

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-11 10:07:50 +02:00
Trent Mick 7a5db08f75
doc(instr-fetch): mention instr-undici for Node.js fetch() (#4624)
Now that instrumentation-undici exists, point to it for users that want
instrumentation of Node.js' fetch().
2024-04-11 10:07:24 +02:00
Marc Pichler 19660dbc96
test(expoerter-*-grpc): use RegExp to match Deadline Exceeded error (#4620) 2024-04-10 17:40:51 +02:00
Marc Pichler 7fb673cc59
feat(sdk-node): remove deprecated methods from NodeSDK (#4609) 2024-04-10 13:31:24 +02:00
Marc Pichler 0b6463e491
feat(sdk-trace-base): log resource attributes in ConsoleSpanExporter (#4605)
* feat(sdk-trace-base): log resoruce attributes in ConsoleSpanExporter

* fixup! feat(sdk-trace-base): log resoruce attributes in ConsoleSpanExporter
2024-04-10 13:17:42 +02:00
Trent Mick c0468673cb
fix(resources): ensure BrowserDetector does not think Node.js v21 is a browser (#4604)
Fixes: #4561
2024-04-04 15:24:53 -07:00
Marc Pichler b78d4432d8
feat(otlp-transformer): consolidate scope/resource creation in transformer (#4600)
* [chore] consolidate scope/resource creation in transformer

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* fixup! [chore] consolidate scope/resource creation in transformer

* fixup! [chore] consolidate scope/resource creation in transformer

* chore: add changelog entry

* fixup! [chore] consolidate scope/resource creation in transformer

---------

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-04-04 15:21:54 +02:00
Abinet18 e01f493a24
Fix invalid timings in span events (#4486)
* fix: use reference value to avoid invalid timings in span

* add comment, add to changelog

* donot report invalid timing in span

* lint fix

* fix failing test

* fix failing test 2

* Add tests

* add removed test

* suggested changes

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-04-03 13:21:31 +02:00
Marc Pichler 5231aa2550
chore: prepare release 1.23.0/0.50.0 (#4601) 2024-04-03 09:57:31 +02:00
Clinton Blackburn 928796d853
feat(sdk-metrics): added synchronous gauge to SDK (#4565)
* feat(instrumentation): added synchronous gauge to SDK

* fixup! feat(instrumentation): added synchronous gauge to SDK

* fixup! feat(instrumentation): added synchronous gauge to SDK

* fixup! feat(instrumentation): added synchronous gauge to SDK

* fixup! feat(instrumentation): added synchronous gauge to SDK

* fixup! feat(instrumentation): added synchronous gauge to SDK
2024-04-02 17:31:15 +02:00
Martin Kuba d66e1d75d4
Add `data` field to the Event interface (#4575)
* add `data` field to the Event interface

* updated body field in the Logs SDK

* updated changelog to breaking change

* lint

* added dedicated type for event data field

* added AnyValue and AnyValueMap types for Event data

* changed body type to LogBody

* markdown lint

* updated Logs SDK

* changed to non-breaking change in the core API

* moved AnyValue to Log API, updated changelog
2024-04-02 10:02:52 +02:00
dependabot[bot] f3aedb76ff
chore(deps): bump express from 4.17.3 to 4.19.2 (#4591)
Bumps [express](https://github.com/expressjs/express) from 4.17.3 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.3...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-29 16:18:09 +01:00
Ievgen Makukh b418d36609
perf(instrumentation-http): remove obvious temp allocations (#4576)
* perf(instrumentation-http): remove obvious temp allocations

* fix: changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-29 12:35:48 +01:00
Mend Renovate 9a5688e61f
chore(deps): update dependency chromedriver to v123 (#4577)
Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-29 12:24:42 +01:00
Jamie Danielson 1a0fb4fd5f
docs(instr-http): document semantic conventions and attributes in use (#4587)
* docs(instr-http): document semantic conventions in use

* add changelog entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-28 14:22:28 +01:00
Mustafa Haddara 900b7d8bfc
feat(opentelemetry-instrumentation-xhr): optionally ignore network events (#4571) 2024-03-28 14:20:51 +01:00
Martin Kuba f6a075be32
Rename EventEmitter to EventLogger in the Events API (#4568)
* renamed EventEmitter to EventLogger

* updated changelog

* renamed remaining references to emitter

* lint
2024-03-25 17:35:20 +01:00
Marylia Gutierrez 97af8e6d4d
feat(sdk-node): add `HostDetector` as default resource detector (#4566)
* feat(node-sdk): add `HostDetector` as default resource detector

Fixes #4282

- Add `HostDetector` to the list of default resource detectors
- Add test to make sure host and process values are being set by default
- Update from deprecated `sdk.detectResources()` to `sdk.start()` on tests
- Update from deprecated `SemanticResourceAttributes.SERVICE_NAME` to `SEMRESATTRS_SERVICE_NAME` on SDK file

* Update experimental/CHANGELOG.md

* fix lint

remove extra lint causing lint error

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-25 16:40:56 +01:00
Martin Kuba fec6286127
Remove domain from the Events API (#4569)
* removed domain from the events API

* lint

* updated changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-25 10:12:25 +01:00
Ievgen Makukh 5fb65b4145
perf(export): do not allocate arrays if resource has no pending async attributes (#4550)
* perf(eport): do not allocate arrays if resource has no pending async attributes

* perf(export): do not use splice if fit in one batch

* Update CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-25 10:03:41 +01:00
Jamie Danielson f9a0d3ec33
refactor(instr-http): use exported strings for semconv (#4573)
* chore(instr-http): use exported strings for semconv

* add changelog entry
2024-03-22 17:17:45 +01:00
Trent Mick 6547440432
fix(sdk-logs): ensure default resource attributes are used as fallbacks when a resource is passed to LoggerProvider (#4564)
Before this Resource.default() attributes would only be used if *no*
resource was given to LoggerProvider. That would mean that
'service.name' and others could be missing, e.g. when called from
NodeSDK.

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-21 13:05:01 +01:00
Marc Pichler 5489797344
chore(changelog): move entry that accidentally ended up in a previous version (#4559)
* chore(changelog): move entry that accidentally ended up in a previous version

* fixup! chore(changelog): move entry that accidentally ended up in a previous version
2024-03-21 13:03:00 +01:00
Martin Kuba aabd1a9b00
SBOM workflow using "npm sbom" (#4521)
* add sbom workflow

* generate sbom for each package

* generate sbom API

* add prefix to all files

* conditionally add artifacts to releases

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-03-20 15:46:52 +01:00
Marc Pichler 3a426e8c32
fix(exporters): use parseHeaders() to ensure header-values are not 'undefined' (#4540)
* fix(exporters): use parseHeaders() to ensure header-values are not 'undefined'

* chore: changelog

* fixup! fix(exporters): use parseHeaders() to ensure header-values are not 'undefined'
2024-03-14 15:21:09 +01:00
Jamie King 1b4999f386
docs: spelling corrections (#4530)
* docs: spelling corrections

* chore: feedback on spelling changes
2024-03-11 10:18:41 +01:00
Marc Pichler a30989f420
Merge pull request #4531 from dynatrace-oss-contrib/next-main-2024-03-07
[next] merge changes from main
2024-03-11 09:45:35 +01:00
dependabot[bot] 7fa2c84e6f
chore(deps-dev): bump ip from 1.1.8 to 1.1.9 (#4495)
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-08 16:58:44 +01:00
Marc Pichler 680406654e [next] merge changes from main 2024-03-07 13:56:45 +01:00
Marc Pichler c379326d92
Merge pull request #4503 from dynatrace-oss-contrib/next-main-2024-02-23
[next] merge changes from `main`
2024-03-07 13:43:26 +01:00
Marc Pichler 63d74cdc36
chore(renovate): remove import-in-the-middle from all-patch group (#4513) 2024-03-06 17:53:41 +01:00
Marc Pichler 5a033e50b3
fix(exporter-*-otlp-grpc)!: lazy load gRPC (#4432)
* fix(exporter-*-otlp-grpc)!: lazy load gRPC
2024-03-06 12:45:22 +01:00
Jackson Weber 75bd7233ea
fix: ConsoleMetricExporter Should Not Export Shallowly (#4522)
* fix: (ConsoleMetricExporter): Increase console log depth to get useful information from metrics.

* update: add contribution to changelog.

* Update CHANGELOG.md
2024-03-06 12:26:39 +01:00
Marc Pichler 3920b158d0
chore: prepare release Experimental 0.49.1 (#4517) 2024-02-29 14:35:54 +01:00
Marc Pichler 8e1996ef0d
fix(instrumentation): remove peer-dependency on @opentelemetry/api-logs (#4515)
* fix(instrumentation): remove peer-dependency on @opentelemetry/api-logs as it's an experimental package

* docs: changelog

* fix: sync package-lock.json
2024-02-29 14:09:39 +01:00
Marc Pichler 7be35c7845
chore: prepare release API 1.8.0/Core 1.21.0/Experimental 0.49.0 (#4504)
* chore: prepare release 1.22.0/0.49.0

* chore: prepare release API 1.8.0
2024-02-29 10:06:15 +01:00
Thomas Burgess 05720ccc41
Fix broken link to getting started page (#4511)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-28 10:45:45 +01:00
Yulin Li f1b2c6d212
fix a wrong internal link in examples readme (#4512) 2024-02-28 09:29:01 +02:00
Nev 5637e2a91c
chore: Semantic Conventions export individual strings (#4298)
* chore: Semantic Conventions export individual strings

* Reduce to just emit full strings and add size-limit test output to review the results

* Update generation to use createConstMap for enums where possible

* Move changelog back to Unreleased -- merge shifted it

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-23 13:00:58 +01:00
Trent Mick aff48a1f00
fix(instr-fetch): do not enable in Node.js; clarify in docs this instr is for web fetch only (#4498)
* fix(instr-fetch): do not enable in Node.js; clarify in docs this instr is for web fetch only

* add a changelog entry

* add a diagnostic warning if attempting to use instr-fetch in Node.js

* fixup! add a diagnostic warning if attempting to use instr-fetch in Node.js

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-23 11:02:06 +01:00
Marc Pichler 12dec9b9cd Merge branch 'main' into next-main-2024-02-23 2024-02-23 10:37:06 +01:00
Marc Pichler 89caef9bb9
Add @david-luna to triagers (#4497) 2024-02-22 13:03:52 +01:00
eldavojohn 356ef8af4a
chore: remove unload event from OTLPExporterBrowserBase (#4438)
* Add the ability for the implementation to provide the binding event for shutdown.

* fix: whoops totally missed the linting formatting fix step

* Remove any concept of a shutdown event

* add change log and obey interface

* no longer need globalthis

* modify the correct changelog and identify this as a breaking change under the scenario in comments

* markdown lint

* Update experimental/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-15 15:07:54 +01:00
Marc Pichler 5bc8cedbd3
fix(otlp-transformer): only use BigInt inside hrTimeToNanos() (#4484)
* fix(otlp-transformer): only use BigInt inside hrTimeToNanos()

* fix: changelog
2024-02-15 14:04:35 +01:00
Marc Pichler 8bbebfd191
feat(instrumentation): add `getModuleDefinitions()` instead of making `init()` public (#4475)
* feat(instrumentation): add getModuleDefinitions() instead of making init() public

* test(instrumetation): add tests for getModuleDefinitions()

* chore: changelog
2024-02-15 13:59:01 +01:00
Marc Pichler 44b0b29dea
Merge pull request #4477 from MikeShi42/patch-1
docs: Update getting started link in README
2024-02-13 09:33:49 +01:00
Mike Shi 7e709a6fd9
docs: Update getting started link in README 2024-02-12 11:49:04 -08:00
Marc Pichler 83becc71bf
Merge pull request #4471 from dynatrace-oss-contrib/next-main-02-09
`[next]` merge changes from `main`
2024-02-12 17:02:25 +01:00
Marc Pichler 01348e6fbc
fix(instrumentation): normalize paths for internal files in scoped packages (#4467)
* fix(instrumentation): normalize paths for internal files in scoped packages

* fix(instrumentation): normalize name passed to onRequire in RequireInTheMiddleSingleton

* fix(instrumentation): apply normalization during filtering internal files

* fix(changelog): add changelog entry

* fix: normalize before filtering

* fix: lint
2024-02-12 13:09:15 +01:00
Marc Pichler 25548fd9a5
feat(context-zone*): support zone.js 0.13.x, 0.14.x (#4469)
* feat(context-zone*): support zone.js 0.13.x, 0.14.x

* fix(changelog): add changelog entry

* fix(changelog): formatting
2024-02-12 13:08:45 +01:00
Marc Pichler 19b433e137 chore: fix conflicts 2024-02-09 14:41:28 +01:00
Marc Pichler b7c53827d4 Merge branch 'main' into next-main-02-09 2024-02-09 14:09:14 +01:00
Chengzhong Wu f86251d40f
docs: shorten readme sections (#4460)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-06 16:43:41 +01:00
Marc Pichler 63845ec2e7
fix(sdk-metrics): allow single bucket histograms (#4456)
* fix(sdk-metrics): allow single bucket histograms

* test(sdk-metrics): undefined and null inputs for bucket boundaries

* fixup! test(sdk-metrics): undefined and null inputs for bucket boundaries
2024-02-06 14:35:15 +01:00
Marc Pichler f6712fd450
fix(sdk-metrics): ignore NaN value recordings for histograms (#4455)
* fix(sdk-metrics): ignore NaN value recordings

* fix(changelog): add changelog entry

* test(exporter-prometheus): adapt tests

* fix(sdk-metrics): ignore in accumulation instead

* fix(changelog): update changelog
2024-02-06 14:20:38 +01:00
Matthew Wear 6d276f4d87
fix: handle zero bucket counts in exponential histogram merge (#4459)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-06 14:12:05 +01:00
Hector Hernandez 588d8ad14d
Allow LoggerProvider to be specified in Instrumentations (#4314)
* Allow LoggerProvider to be specified in Instrumentations

* Update

* Lint

* Add test

* npm i

* Update changelog

* npm i

* marking setLoggerProvider as optional

* Add check for possible undefined method

* npm i
2024-02-06 11:19:51 +01:00
drewcorlin1 0229434cb5
feat(instrumentation): make InstrumentationAbstract.init public (#4418)
* Make InstrumentationAbstract.init public

* Update changelog

* Update JSDoc

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-02-05 13:50:03 +01:00
Naseem 72c60f17ef
feat(node-sdk): add spanProcessors option (#4454) 2024-02-05 07:05:31 -05:00
Marc Pichler 2df6310351
refactor(instrumentation-grpc): clean up remnants of 'grpc' package instrumentation (#4420)
* refactor(instrumentation-grpc): clean up remnants of 'grpc' package instrumentation

* fix(changelog): add changelog entry
2024-01-31 16:41:16 +01:00
Jackson Weber efa6307319
fix(sdk-node): Allow Defining Sampler with Exporter in Env (#4394)
* fix(sdk-node): Allow tracerProvider to be created when exporter is defined in the env.

* fix(node-sdk): Update to not accept when exporter is set to none.

* fix(sdk-node): Update Changelog.

* fix(sdk-node): Fix Changelog.

* fix(sdk-node): cleanup changelog.

* fix(sdk-node): lint fix

* fix(sdk-node): Fix logic for creating tracerProviders.

* Fix lint.

* Update experimental/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Fix manual sampler and environment exporter case.

* Update logic to check for a defined traceExporter on the config before using the NodeTracerProvider.

* Fix equality check.

* Update env exporter configuration logic and add tests.

* Update experimental/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Fix changelog issues.

* Clean up tracerProvider logic.

* Update sdk.ts

* Update sdk.ts

* Update experimental/packages/opentelemetry-sdk-node/test/sdk.test.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update experimental/packages/opentelemetry-sdk-node/test/sdk.test.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update experimental/packages/opentelemetry-sdk-node/test/sdk.test.ts

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-31 09:11:45 -05:00
Chengzhong Wu ac75b70dde
fix(api): fix unreachable @opentelemetry/api/experimental entry (#4446) 2024-01-31 11:57:28 +08:00
Marc Pichler c98a5d31ea
chore: remove checked in auto-generated version.js files (#4448) 2024-01-31 10:50:54 +08:00
Aksel Allas 4655895ba1
feat(add-aggregation-selector-option-to-otlp-metric-exporter) (#4409) 2024-01-29 10:23:38 +01:00
Marc Pichler 828f2ed730
chore: prepare release 1.21.0/0.48.0 (#4442)
* chore: prepare release 1.21.0/0.48.0

* chore: sync package-lock.json
2024-01-26 06:53:40 +01:00
rdeavila94 37119908d6
fix(instrumentation-fetch): compatibility with Map inputs for request headers with fetch (#4348)
* fix(@opentelemetry-instrumentation-fetch): compatibility with Map inputs for request headers with fetch

* Update experimental/CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* adding description for ts-ignore

* fix(changlog): move entry to unreleased

* fix: add lint ignore

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-25 09:45:37 +01:00
François 5afbcdbe0a
docs: add observableGauge to the prometheus experimental example (#4267)
* docs: add observableGauge to the prometheus experimental example

Signed-off-by: Francois LP <francois.le.pape@gmail.com>

* docs: add gauge image to README

Signed-off-by: Francois LP <francois.le.pape@gmail.com>

* refactor: change comment wording

from @pichlermarc

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Signed-off-by: Francois LP <francois.le.pape@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2024-01-25 08:52:41 +01:00
Chengzhong Wu bf4d553ef8
refactor(exporter-prometheus): promisify prometheus tests (#4431)
* refactor(exporter-prometheus): promisify prometheus tests

* fix: lint

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-25 08:52:10 +01:00
Vladimir Adamić df63272408
fix(exporter-logs-otlp-*): set User-Agent header (#4398)
* fix(exporter-logs-otlp-grpc): set User-Agent header

* fix(exporter-logs-otlp-http): set User-Agent header

* fix(exporter-logs-otlp-proto): set User-Agent header

* chore(changelog): update changelog

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-25 08:39:16 +01:00
Marc Pichler 8648313ed8
fix(instrumentation)!: pin import-in-the-middle@1.7.1 (#4441)
* fix(instrumentation): pin import-in-the-middle@1.7.1

* fix(changelog): add changlog entry

* Update experimental/CHANGELOG.md

Co-authored-by: Trent Mick <trentm@gmail.com>

* fix(changelog): additional details

* fix(changelog): formatting

* fix(changelog): lint

---------

Co-authored-by: Trent Mick <trentm@gmail.com>
2024-01-25 08:20:47 +01:00
Zirak 0635ab1c6c
fix(sdk-trace-base): Export processed spans while exporter failed (#4287)
* fix(sdk-trace-base): Export processed spans while exporter failed

While the exporter deals with a batch of spans, new spans may come in and wait
to be exported. As previously implemented, a successful export would notice
these waiting spans, triggering a renewed timer check, but not so for an
unsuccessful export.

The result was that, prior to this commit, a failing export may end up in a
situation where no further spans will be exported. This is due to the behaviour
of `_addToBuffer` when the queue is full: Imagine an export which fails after a
long timeout (because of, for instance, network troubles). While the connection
waits to be timed out, the span queue fills up. Once completely full, no new
calls to recheck the timer will be done. On its own, this behaviour is
fine. When combined with the patched bug, this leads to a rather confusing case
where the exporter never tries exporting.

* fix(changelog): add entry

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-24 15:57:13 +01:00
Marc Pichler a9af247259
feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option (#4419)
* feat(sdk-metrics)!: remove MeterProvider.addMetricReader() in favor of constructor option

* fix(changelog): add changelog entry
2024-01-24 14:38:18 +01:00
Marc Pichler 0f6518dd63
feat(sdk-metrics): deprecate MeterProvider.addMetricReader() in favor of 'readers' constructor option (#4427)
* feat(sdk-metrics): add 'readers' constructor option, deprecate MeterProvider.addMetricReader()

* fix(changelog): update changelog entry, fix format
2024-01-24 14:30:06 +01:00
Jamie Danielson 0aba75ceef
chore(otel-resources): replace deprecated spanAttributes (#4428)
* chore(otel-resources): replace deprecated spanAttributes

* update minimum api version to 1.1

* update changelog

* per legendecas, add todo for ResourceAttributes

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-22 23:35:50 +08:00
Jamie Danielson 97276869cd
chore(shim-opentracing): replace deprecated spanAttributes (#4430)
* chore(shim-opentracing): replace deprecated spanAttributes

* update minimum api version to 1.1

* keep newline in package.json

* update changelog
2024-01-19 12:47:12 +01:00
Chengzhong Wu 43e598e7c1
test: transpile zone.js products in test (#4423) 2024-01-18 10:42:50 +01:00
Marc Pichler 2a3c26437f
refactor(core): drop unnecessary assignment of HOSTNAME (#4421)
* fix(core): drop unnecessary assignemnt of HOSTNAME

* fix(changelog): add changelog entry

* Update CHANGELOG.md

* fix(changelog): move entry to internal
2024-01-18 11:46:04 +08:00
Jamie Danielson 7f613e0491
chore(otel-core): replace deprecated SpanAttributes (#4408)
* chore(otel-core): replace deprecated spanAttributes

* update changelog

* keep new line at bottom of package.json
2024-01-17 09:00:17 +01:00
Rodger Brennan bf8714edcb
chore(opentelemetry-context-zone-peer-dep): support zone.js ^v0.13.0 (#4320)
* chore(opentelemetry-context-zone-peer-dep):
update deps to support angular 16
closes issue #4245

Signed-off-by: rbrennan <4884521+rodgerbrennan@users.noreply.github.com>

* update packages

* Revert "update packages"

This reverts commit 624df4ea2e.

* chore: sync package-lock.json

* chore: sync package-lock.json

* chore: sync package-lock.json

* Update ZoneContextManager.test to use ES5 UMD bundle

* add changelog

* remove trailing space from changelog

---------

Signed-off-by: rbrennan <4884521+rodgerbrennan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-17 11:45:56 +08:00
Sebastian Poxhofer 71ef1b1f2c
feat(SugaredTracer): add draft of sugaredTracer (#3317)
* feat(api): add experimental package and SugaredTracer

* tests(api/experimental): add tests

* fix: packages.json exports

* move export into experimental package

* add additional tests

* fix: do not use catch and finally for compatibility with Node 8

---------

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2024-01-16 17:25:17 +08:00
Marc Pichler 6898a34512
fix(sdk-trace-base): ensure attribute value length limit is enforced on span creation (#4417)
* fix(sdk-trace-base): ensure attribute value length limit is enforced on span creation

* fix(changelog): add changelog entry
2024-01-15 15:53:52 +01:00
Daniel Dyla fac6d147a1
[next] remove README and add warning (#4226)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-15 15:52:51 +01:00
Marc Pichler 57008533ab
chore: prepare release 1.20.0/0.47.0 (#4410)
* chore: prepare release 1.20.0/0.47.0

* Update experimental/CHANGELOG.md

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>

* fix(readme): add entry to compatibility matrix

---------

Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
2024-01-15 10:58:49 +01:00
dependabot[bot] b7e3d44fd1
chore(deps): bump follow-redirects from 1.15.3 to 1.15.4 (#4411)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 14:22:29 +01:00
Vladimir Adamić ae0a3c522d
fix(exporter-logs-otlp-proto): programatic headers take precedence ov… (#4351)
* fix(exporter-logs-otlp-proto): programatic headers take precedence over environment variables

* chore: update PR url in changelog

* chore: fix deletion of env var

* fix(exporter-logs-otlp-http): programatic headers take precedence over environment variables

* fix(exporter-trace-otlp-http): programatic headers take precedence over environment variables

* fix(exporter-trace-otlp-proto): programatic headers take precedence over environment variable

* chore: update CHANGELOG

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2024-01-03 17:42:17 +01:00
Marc Pichler b36ab12d16
fix(instrumentation): do not import 'path' in browser runtimes (#4386)
* fix(instrumentation): do not import 'path' in browser runtimes

* fix(changelog): clean up and add entry

* fix(instrumentation): add missing license header

* fix(changelog): formatting

* fix(instrumentation): do not throw
2024-01-03 17:41:23 +01:00
Mend Renovate 0206181c49
chore(deps): update github/codeql-action action to v3 (#4391) 2024-01-03 14:17:16 +01:00
Marc Pichler f4b681d4f3
fix(instrumentation): use caret range on import-in-the-middle (#4380)
* fix(instrumentation): use caret on import-in-the-middle

* fix: add chanelog entry

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-12-20 14:32:52 +01:00
Siim Kallas a512494ba2
perf: remove unnecessary base64 encode+decode from OTLP export (#4343)
* fix: remove unnecessary base64 encoding for span contexts

* chore: add changelog

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-12-19 16:05:32 -05:00
Mend Renovate 42aaae0270
chore(deps): update dependency chromedriver to v120 (#4374) 2023-12-19 14:59:34 -05:00
C. T. Lin 3cf2cf60c5
fix(instrumentation): bump import-in-the-middle to 1.7.2 (#4379) 2023-12-19 13:40:28 +01:00
Marc Pichler 37add77095
fix(ci): ensure deploy workflow does not override benchmark data (#4376) 2023-12-18 17:58:30 +01:00
Martin Kubliniak 3e59291321
feat(sdk-trace-base): improve log messages when dropping span events (#4223) 2023-12-15 15:36:29 +08:00
Hector Hernandez d828041a52
fix(sdk-logs): await async resources in log processors (#4349) 2023-12-15 14:09:35 +08:00
Marc Pichler d3c311aec2
chore: prepare release 1.19.0/0.46.0 (#4358)
* chore: prepare release 1.19.0/0.46.0

* fix(changelog): move entry
2023-12-14 13:17:38 +01:00
Mend Renovate 02de4ab720
chore(deps): update dependency @types/webpack to v5 (#4368) 2023-12-14 10:35:52 +01:00
Mend Renovate d286bf6498
fix(deps): update dependency import-in-the-middle to v1.7.1 (#4367) 2023-12-14 09:57:42 +01:00
Daniel Dyla 1cbaaf08b2
chore(deps): update webpack to latest (#4340)
* Update webpack to latest

* Skip tree shake test on node 8

* Update webpack utility modules

* lint

* Apply review comments

* Invert test skip

* Use process.versions.node

* Remove approval requirement for webpack
2023-12-13 14:36:54 -05:00
Daniel Dyla ba00147a77
chore: remove checks for unsupported versions (#4341)
* chore: remove checks for unsupported versions

* Remove final version checks

* Changelog

* Lint
2023-12-13 09:32:42 -05:00
Daniel Dyla ea8bfa283a
`[next]` merge changes from `main` (#4363)
* Add Trent to approvers (#4311)

* chore(renovate): require dashboard approval for lerna updates (#4276)

* chore(ci): install semver globally to speed up "peer-api" workflow (#4270)

Closes: #4242

* fix(ci): remove token setup via environment variable from .npmrc (#4329)

* fix(instrumentation-http): resume responses when there is no response listener

Fixes a memory leak where unhandled response bodies pile up in node 20

* feat: add script to update changelogs on release preparation (#4315)

* feat: add script to update changelogs on releases

* fix: address comments

* Apply suggestions from code review

Co-authored-by: Trent Mick <trentm@gmail.com>

* fix: apply suggestions from code review

* fix: use packageJson.version instead of version

---------

Co-authored-by: Trent Mick <trentm@gmail.com>

* Fix event name

* test: make rawRequest HTTP-compliant

* Add node 20 to test matrix

* Enable old hash functions on 20

* Fix esm handling for iitm node 20

* Use err.code to make test more reliable

* Changelog

* nit: single import

* Remove unused files

* Add v20 to supported runtimes

* ci: add npm cache in actions/setup-node (#4271)

* feat(sdk-logs): add droppedAttributesCount field to ReadableLogRecord (#4289)

* feat(sdk-logs): add droppedAttributesCount field to ReadableLogRecord

* chore: check droppedAttributesCount value in test case

* feat(otlp-transformer): make toLogRecord() use ReadableLogRecord.droppedAttributesCount

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* fix(api-logs): allow passing in TimeInput for LogRecord (#4345)

* fix: allow passing in TimeInput for LogRecord

* chore: update changelog

* fix: programmatic url and headers take precedence in metric exporters… (#4334)

* fix: programmatic url and headers take precedence in metric exporters (#2370)

* chore: adjust grpc exporter metrics test

* chore(changelog): update changelog

* fix(instrumentation-http): do not mutate given headers object for outgoing http requests (#4346)

Fixes: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1609

* chore(deps): update actions/stale action to v9 (#4353)

* fix(deps): update dependency import-in-the-middle to v1.6.0 (#4357)

* chore(deps): update all patch versions (#4306)

* chore(ci): use node 20 in lint workflow (#4359)

* chore(deps): update dependency linkinator to v6 (#4237)

* fix(otlp-exporter-base): decrease default concurrency limit to 30 (#4211)

* fix(otlp-exporter-base): decrease concurrency limit to 30

* fix(changelog): add changelog entry

* chore(deps): use actions/checkout >4 instead of 4.0.0 exactly (#4361)

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: strivly <133362191+strivly@users.noreply.github.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: lyzlisa <34400837+lyzlisa@users.noreply.github.com>
Co-authored-by: Hyun Oh <hyunnoh01@gmail.com>
Co-authored-by: Siim Kallas <siimkallas@gmail.com>
Co-authored-by: Vladimir Adamić <441333+Vunovati@users.noreply.github.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
2023-12-13 08:57:52 -05:00
Marc Pichler 4fe1ae8aaf
chore(deps): use actions/checkout >4 instead of 4.0.0 exactly (#4361) 2023-12-13 10:16:19 +01:00
Marc Pichler af4f7a9daf
fix(otlp-exporter-base): decrease default concurrency limit to 30 (#4211)
* fix(otlp-exporter-base): decrease concurrency limit to 30

* fix(changelog): add changelog entry
2023-12-13 16:47:52 +08:00
Mend Renovate dddab06aa4
chore(deps): update dependency linkinator to v6 (#4237) 2023-12-12 17:04:22 +01:00
Marc Pichler 6be10fbd8d
chore(ci): use node 20 in lint workflow (#4359) 2023-12-12 16:53:35 +01:00
Mend Renovate 237c757242
chore(deps): update all patch versions (#4306) 2023-12-12 16:43:29 +01:00
Mend Renovate 9349c68c2f
fix(deps): update dependency import-in-the-middle to v1.6.0 (#4357) 2023-12-12 14:16:42 +01:00
Mend Renovate 4e77c1dee6
chore(deps): update actions/stale action to v9 (#4353) 2023-12-12 13:54:48 +01:00
Daniel Dyla 09bdeba200
chore: require changelog entries for next branch (#4342) 2023-12-12 11:15:02 +08:00
Trent Mick 5b0fb7b40d
fix(instrumentation-http): do not mutate given headers object for outgoing http requests (#4346)
Fixes: https://github.com/open-telemetry/opentelemetry-js-contrib/issues/1609
2023-12-06 08:08:18 -08:00
Vladimir Adamić 4daa2640d2
fix: programmatic url and headers take precedence in metric exporters… (#4334)
* fix: programmatic url and headers take precedence in metric exporters (#2370)

* chore: adjust grpc exporter metrics test

* chore(changelog): update changelog
2023-12-06 11:51:17 +01:00
Siim Kallas 104a5e8867
fix(api-logs): allow passing in TimeInput for LogRecord (#4345)
* fix: allow passing in TimeInput for LogRecord

* chore: update changelog
2023-12-06 10:14:24 +01:00
Hyun Oh dcf93e8506
feat(sdk-logs): add droppedAttributesCount field to ReadableLogRecord (#4289)
* feat(sdk-logs): add droppedAttributesCount field to ReadableLogRecord

* chore: check droppedAttributesCount value in test case

* feat(otlp-transformer): make toLogRecord() use ReadableLogRecord.droppedAttributesCount

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-12-05 08:48:21 -05:00
lyzlisa 9e9453649d
ci: add npm cache in actions/setup-node (#4271) 2023-12-01 10:30:50 -08:00
Daniel Dyla 6dd075cdf6
Merge pull request #4336 from dyladan/test-20
Add node 20 to test matrix
2023-12-01 11:20:54 -05:00
Daniel Dyla 1447ad5223
Add v20 to supported runtimes 2023-12-01 11:10:56 -05:00
Daniel Dyla a81e0eaa14
Remove unused files 2023-11-30 11:48:22 -05:00
Daniel Dyla c4e75fb953
nit: single import 2023-11-30 11:47:08 -05:00
Daniel Dyla 0b7dc46f56
Changelog 2023-11-30 09:52:26 -05:00
Daniel Dyla 317c93dec8
Use err.code to make test more reliable 2023-11-30 09:49:36 -05:00
Daniel Dyla 3e2fcdaebb
Fix esm handling for iitm node 20 2023-11-30 09:48:11 -05:00
Daniel Dyla c0034ce3e5
Enable old hash functions on 20 2023-11-30 09:31:03 -05:00
Daniel Dyla d0d95816b9
Add node 20 to test matrix 2023-11-30 09:23:34 -05:00
Daniel Dyla 593d220465
Merge pull request #4335 from dyladan/node-20-test
test: make rawRequest HTTP-compliant
2023-11-30 09:22:44 -05:00
Daniel Dyla 0a52166bbd
Merge branch 'main' into node-20-test 2023-11-30 09:14:14 -05:00
Daniel Dyla cc4ff2d158
Merge pull request #4332 from dyladan/node-20-leak
fix(instrumentation-http): resume responses when there is no response…
2023-11-30 09:10:53 -05:00
Daniel Dyla 3f96f1ff83
Merge branch 'main' into node-20-leak 2023-11-30 09:02:09 -05:00
Daniel Dyla 1dda06a803
Merge branch 'main' into node-20-test 2023-11-30 08:58:34 -05:00
Daniel Dyla 470a2bf79b
test: make rawRequest HTTP-compliant 2023-11-30 08:38:58 -05:00
Daniel Dyla bf8ee62a1e
Fix event name 2023-11-30 08:37:03 -05:00
Marc Pichler f654636502
feat: add script to update changelogs on release preparation (#4315)
* feat: add script to update changelogs on releases

* fix: address comments

* Apply suggestions from code review

Co-authored-by: Trent Mick <trentm@gmail.com>

* fix: apply suggestions from code review

* fix: use packageJson.version instead of version

---------

Co-authored-by: Trent Mick <trentm@gmail.com>
2023-11-30 08:50:29 +01:00
Daniel Dyla 762a65a6e4
fix(instrumentation-http): resume responses when there is no response listener
Fixes a memory leak where unhandled response bodies pile up in node 20
2023-11-29 16:12:03 -05:00
Marc Pichler 38db748685
fix(ci): remove token setup via environment variable from .npmrc (#4329) 2023-11-29 17:28:21 +01:00
strivly 8067d97210
chore(ci): install semver globally to speed up "peer-api" workflow (#4270)
Closes: #4242
2023-11-23 15:54:44 -08:00
Daniel Dyla 35be022db1
Merge pull request #4295 from dyladan/deprecate-old-runtimes
[next] Deprecate old runtimes
2023-11-22 10:39:37 -05:00
Daniel Dyla 543f0b470c
Benchmark a tested version 2023-11-22 08:08:57 -05:00
Marc Pichler b3a539d301
chore(renovate): require dashboard approval for lerna updates (#4276) 2023-11-22 06:55:04 +01:00
Daniel Dyla 3b8f0aff95
Merge branch 'deprecate-old-runtimes' of github.com:dyladan/opentelemetry-js into deprecate-old-runtimes 2023-11-21 12:40:06 -05:00
Daniel Dyla dc10b81ee9
Bump to 18 on other workflows 2023-11-21 12:39:58 -05:00
Daniel Dyla 5be08f47f0
Merge branch 'next' into deprecate-old-runtimes 2023-11-21 08:04:16 -05:00
Daniel Dyla 26fcb884fd
Merge pull request #4308 from dyladan/next-main-11-16
[next] merge main
2023-11-21 08:03:53 -05:00
Daniel Dyla 079c1f547a
Add Trent to approvers (#4311) 2023-11-20 10:33:26 -05:00
Daniel Dyla 21da78f76c
Export node module file 2023-11-20 10:20:07 -05:00
Daniel Dyla 4cbb6351f8
Move node module file to root 2023-11-20 10:09:33 -05:00
Daniel Dyla bf30779119
Do not export node-specific names 2023-11-20 09:56:53 -05:00
Daniel Dyla 343ca78015
lint 2023-11-17 14:29:53 -05:00
Daniel Dyla d229b3ad31
Temporarily disable node 20 2023-11-17 14:29:53 -05:00
Daniel Dyla 7cf46c794b
Name exports to fix ESM tests 2023-11-17 14:29:53 -05:00
Daniel Dyla 9d62673d2c
Fix prom test for node 20 2023-11-17 14:29:52 -05:00
Daniel Dyla ab52a8420a
[next] deprecate 14,16 and support 20 2023-11-17 14:29:51 -05:00
Daniel Dyla 6031bb4ddc
Merge branch 'next' into next-main-11-16 2023-11-17 08:29:27 -05:00
Daniel Dyla ba4de42a4b
Execute binaries from root node modules (#4304) 2023-11-17 07:40:02 +01:00
Daniel Dyla e0efd7aa3d
Merge remote-tracking branch 'origin/main' into next-main-11-16 2023-11-16 16:09:45 -05:00
Daniel Dyla 51be418b3d
Execute binaries from root node modules (#4302) 2023-11-16 15:56:26 -05:00
Mend Renovate 4eddf51eb9
chore(deps): update all patch versions (#4255) 2023-11-15 15:32:57 -05:00
Marc Pichler 2c7d5c427f
chore: fix npm release preparation scripts, add .npmrc and release script (#4275)
Co-authored-by: Trent Mick <trentm@gmail.com>
2023-11-15 18:44:57 +01:00
Daniel Dyla 0f8aa7924f
Update `next` branch (#4294)
* chore: track package-lock.json (#4238)

* chore: track package-lock.json

* Pin to old versions for node 14

* Use version range

* Remove unused cached directories

* Temporarily disable other tests

* Temporarily enable only api test

* Enable only some packages

* Test only api packages

* Test trace exporters

* Fix line ordering

* Test all packages except otlp exporters

* Add trace http exporter

* Add trace proto exporter

* Test all but grpc exporters

* chore: use npm workspaces and degrade lerna to v6

* chore: get rid of lerna bootstrap

* chore: use npx

* chore: allow install scripts to setup buf

* chore: fix w3c-integration-test cache key

* chore: fix cache key

* chore: disable resource compat test

* chore: fix node_modules assumptions

* chore: fix hoisted karma issue

* chore: fix markdown linter complaints

* chore: lock @grpc/grpc-js to v1.8.21

* Break caches

* chore: remove cache

* chore: fixup inline commands

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* docs: fixed link to benchmark results (#4233)

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

* chore(deps): update all patch versions (#4215)

* fix: otlp json encoding (#4220)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* fix: remove duplicate export star from version.ts (#4225)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* docs: fix sdk-node config instructions (#4249)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* feat(api): publish api esnext target (#4231)

* chore: release API 1.7.0/Core 1.18.0/Experimental 0.45.0 (#4254)

* fix(sdk-metrics): hand-roll MetricAdvice type as older API versions do not include it (#4260)

* chore: prepare release 1.18.1/0.45.1 (#4261)

* chore: no need for 'packages' in "lerna.json" (#4264)

* Benchmark tests for trace OTLP transform and BatchSpanProcessor (#4218)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore: type reference on zone.js (#4257)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* docs: add docker-compose to run prometheus for the experimental example (#4268)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* fix(sdk-logs): avoid map attribute set when count limit exceeded (#4195)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* chore(deps): update dependency chromedriver to v119 [security] (#4280)

* chore(deps): update actions/setup-node action to v4 (#4236)

* fix(sdk-trace-base): processor onStart called with a span having empty attributes (#4277)

Co-authored-by: artahmetaj <artahmetaj@yahoo.com>

* Update fetch instrumentation to be runtime agnostic (#4063)

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

---------

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Martin Kuba <martin@martinkuba.com>
Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Siim Kallas <siimkallas@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: David Luna <david.luna@elastic.co>
Co-authored-by: Dinko Osrecki <dinko.osrecki@emarsys.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: François <32224751+Lp-Francois@users.noreply.github.com>
Co-authored-by: Hyun Oh <hyunnoh01@gmail.com>
Co-authored-by: André Cruz <andremiguelcruz@msn.com>
Co-authored-by: artahmetaj <artahmetaj@yahoo.com>
Co-authored-by: drewcorlin1 <82601620+drewcorlin1@users.noreply.github.com>
2023-11-15 11:15:51 -05:00
drewcorlin1 5ed54c8a09
Update fetch instrumentation to be runtime agnostic (#4063)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-15 17:09:15 +01:00
André Cruz 10f6c46057
fix(sdk-trace-base): processor onStart called with a span having empty attributes (#4277)
Co-authored-by: artahmetaj <artahmetaj@yahoo.com>
2023-11-15 15:28:45 +01:00
Mend Renovate b0c0ace8fc
chore(deps): update actions/setup-node action to v4 (#4236) 2023-11-14 08:56:13 +01:00
Mend Renovate b41cada2d2
chore(deps): update dependency chromedriver to v119 [security] (#4280) 2023-11-13 14:55:15 +01:00
Hyun Oh f5ef8de1cc
fix(sdk-logs): avoid map attribute set when count limit exceeded (#4195)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-09 17:19:46 +01:00
François 40fde0f69f
docs: add docker-compose to run prometheus for the experimental example (#4268)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-09 17:17:44 +01:00
Chengzhong Wu f2b447dad5
chore: type reference on zone.js (#4257)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-09 15:25:11 +01:00
Martin Kuba 654638a430
Benchmark tests for trace OTLP transform and BatchSpanProcessor (#4218)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-09 14:57:00 +01:00
Trent Mick c478c11975
chore: no need for 'packages' in "lerna.json" (#4264) 2023-11-09 14:32:18 +01:00
Marc Pichler f665499096
chore: prepare release 1.18.1/0.45.1 (#4261) 2023-11-08 18:51:43 +01:00
Marc Pichler c7c1867c82
fix(sdk-metrics): hand-roll MetricAdvice type as older API versions do not include it (#4260) 2023-11-08 12:56:29 +01:00
Marc Pichler 73b446688f
chore: release API 1.7.0/Core 1.18.0/Experimental 0.45.0 (#4254) 2023-11-07 11:25:24 +01:00
Chengzhong Wu 9fd1948e0d
feat(api): publish api esnext target (#4231) 2023-11-07 10:25:33 +01:00
Dinko Osrecki d434f84253
docs: fix sdk-node config instructions (#4249)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-06 16:13:09 +01:00
David Luna cd232cde14
fix: remove duplicate export star from version.ts (#4225)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-06 16:11:05 +01:00
Siim Kallas 9db6352d30
fix: otlp json encoding (#4220)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-11-06 16:09:52 +01:00
Mend Renovate 586def466b
chore(deps): update all patch versions (#4215) 2023-11-06 11:27:06 +01:00
Martin Kuba 95471d1cce
docs: fixed link to benchmark results (#4233)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2023-11-02 11:08:17 +08:00
Chengzhong Wu e9328abb68
chore: track package-lock.json (#4238)
* chore: track package-lock.json

* Pin to old versions for node 14

* Use version range

* Remove unused cached directories

* Temporarily disable other tests

* Temporarily enable only api test

* Enable only some packages

* Test only api packages

* Test trace exporters

* Fix line ordering

* Test all packages except otlp exporters

* Add trace http exporter

* Add trace proto exporter

* Test all but grpc exporters

* chore: use npm workspaces and degrade lerna to v6

* chore: get rid of lerna bootstrap

* chore: use npx

* chore: allow install scripts to setup buf

* chore: fix w3c-integration-test cache key

* chore: fix cache key

* chore: disable resource compat test

* chore: fix node_modules assumptions

* chore: fix hoisted karma issue

* chore: fix markdown linter complaints

* chore: lock @grpc/grpc-js to v1.8.21

* Break caches

* chore: remove cache

* chore: fixup inline commands

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-11-01 19:51:24 -04:00
Luismi Ramírez 1c7d7a3542
fix(sdk-node) Remove @opentelemetry/exporter-jaeger explicit dependency (#4214) 2023-10-19 08:14:18 +02:00
Marc Pichler 7f52f70d22
fix: bump deploy docs workflow to node 18 (#4199) 2023-10-18 13:57:07 +02:00
Mend Renovate 00e78efd84
chore(deps): update all patch versions (#4194) 2023-10-17 12:36:24 +02:00
Chengzhong Wu b6e532bf52
feat(metrics): prototype experimental advice support (#3876)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-10-11 10:05:03 +02:00
Marc Pichler f8e187b473
chore: release SDK 1.17.1/Experimental 0.44.0 (#4183) 2023-10-10 15:46:49 +02:00
Marc Pichler 4eb10f7c9d
fix(sdk-metrics): prevent per-reader storages from keeping unreported accumulations in memory (#4163) 2023-10-10 15:27:12 +02:00
Daniel Dyla c320c981c5
deps: update proto-loader (#4192) 2023-10-07 17:53:41 +08:00
Marc Pichler 5fd3737aa3
chore: remove outdated and empty docs (#4181) 2023-10-07 17:40:54 +08:00
Mend Renovate 84861cd827
chore(deps): update dependency @types/jquery to v3.5.21 (#4187)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-10-06 10:30:35 -04:00
Einar Norðfjörð 912256184c
fix: BatchExporter should export continuously when batch size is reached (#3958)
* fix: BathExporter should export continuously when batch size is reached

* fix: add tests

* lintfix

* add changelog

* add test for concurrency

* Update CHANGELOG.md

* Apply suggestions from code review

* Lint and fix browser tests

* fix: lint

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-10-06 10:27:47 -04:00
Martin Kuba 5ce32c0fe5
Added performance benchmarking doc (#4169)
Co-authored-by: Tyler Benson <tylerbenson@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-10-04 09:02:25 +02:00
Mend Renovate 5af865386a
chore(deps): update dependency @types/sinon to v10.0.18 (#4179) 2023-10-03 15:59:56 +02:00
Marc Pichler 868f75e448
fix(benchmark): write benchmark results to file (#4172) 2023-10-01 22:00:15 +02:00
Martin Kuba c84698d4a1
Benchmark tests workflow (#4144)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-29 06:45:56 +02:00
Marc Pichler 52f428a9f1
fix(sdk-metrics): do not report empty scopes and metrics (#4135) 2023-09-28 14:17:06 +02:00
FelipeEmerim f0ceabc57c
fix(exporter-zipkin): round timestamp to nearest integer in zipkin annotations (#4167)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-28 14:15:48 +02:00
Siim Kallas 513d0679a5
fix(otlp-transformer): avoid precision loss when converting HrTime to unix nanoseconds (#4062)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-28 13:44:17 +02:00
Mend Renovate 6bf1b78653
chore(deps): update all patch versions (#4161) 2023-09-28 09:07:34 +02:00
cristianmadularu 24997089da
fix(otlp-exporter-base): replaced usage of window with _globalThis (#4157)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-26 14:58:07 +02:00
Chengzhong Wu 2b9832ecb5
fix(sdk-logs): hide internal methods with internal shared state (#3865)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-26 09:13:58 +08:00
Aaron Abbott f2fc0d8787
fix(sdk-metrics): allow instrument names to contain '/' (#4155) 2023-09-21 10:02:50 +02:00
Martin Kuba 1a8652aa54
Introduce benchmark tests (#4105)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-09-19 16:39:10 +02:00
Aaron Abbott cbc5c52085
docs: update OpenCensus shim example for metrics (#4078) 2023-09-19 11:07:26 +02:00
Marc Pichler be1627267f
feat(exporter-metrics-otlp-proto): add esm build (#4099) 2023-09-18 17:30:52 +02:00
Mend Renovate ed27a37678
chore(deps): update dependency eslint-config-prettier to v9 (#4042) 2023-09-18 16:10:30 +02:00
Mend Renovate f038b44fe9
chore(deps): update all patch versions (#4152) 2023-09-18 13:57:30 +02:00
Mend Renovate 30d1fcac78
chore(deps): update all patch versions (#4147) 2023-09-15 06:59:39 +02:00
Aaron Abbott 4a4059bc85
feat(opencensus-shim): implement OpenCensus metric producer (#4066) 2023-09-14 23:17:43 +02:00
Marc Pichler 937cfaa64b
fix(readme): update compatibility table and remove API column (#4104) 2023-09-14 11:33:47 +02:00
Vadim Korolik 5615b1c185
fix(sdk-node): move @opentelemetry/exporter-jaeger to dev dependencies (#4049) 2023-09-13 09:12:20 +02:00
Marc Pichler 4f28f90fd9
fix(codeql): run workflow for pushes to main and pull requests (#4110) 2023-09-12 17:02:42 +02:00
Vladimir Adamić f6ebf0e1d6
chore(exporter-logs-otlp-proto): rename OTLPLogsExporter to OTLPLogEx… (#4140) 2023-09-12 16:46:20 +02:00
Marc Pichler faf939c775
chore: release API 1.6.0/SDK 1.17.0/Experimental 0.43.0 (#4138) 2023-09-12 13:47:22 +02:00
Marc Pichler 27897d6c34
Revert "feat(api): add attributes argument to recordException API (#4071)" (#4137) 2023-09-11 17:36:09 +02:00
Marc Pichler 5fcd8cf136
chore: prepare release API 1.5.0, SDK 1.16.0/0.42.0 (#4122) 2023-09-11 14:01:30 +02:00
Mend Renovate 5d94185e2e
chore(deps): update actions/checkout action to v4 (#4134) 2023-09-11 13:57:44 +02:00
Mend Renovate ba38804c05
chore(deps): update all patch versions (#4114) 2023-09-08 12:20:57 -04:00
Marc Pichler 415b198c03
fix(ci): pin nx to 15.9.6 for Node.js v14 (#4124) 2023-09-07 10:20:44 +02:00
Chengzhong Wu 4d662cf84d
fix(sdk-metrics): metric names should be case-insensitive (#4059)
* fix(sdk-metrics): metric names should be case-insensitive

* fixup!

* fixup!
2023-09-07 08:41:06 +03:00
matthew 9452607a7f
docs(guidelines) tiny fix, add comma on docs (#4119) 2023-09-06 11:13:53 +02:00
Mend Renovate 6d174e2a06
chore(deps): update dependency markdownlint-cli to v0.36.0 (#4113) 2023-09-04 13:22:14 +02:00
Marc Pichler cacb8259ef
fix: limit npm to <10.0.0 on node v14 and v16 (#4111) 2023-09-02 20:46:58 +02:00
Mend Renovate 5b7f619130
chore(deps): update dependency @babel/preset-env to v7.22.14 (#4103) 2023-08-31 13:04:59 +02:00
Mend Renovate 1da2b1bb11
chore(deps): update dependency prettier to v3.0.3 (#4092)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-30 16:05:51 +02:00
Dima Voytenko cd4998a4b5
feat(api): add attributes argument to recordException API (#4071)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-30 16:04:34 +02:00
Marc Pichler c84637f264
fix(exporter-logs-otlp-http): add @opentelemetry/api-logs as dependency (#3968)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-29 15:29:16 +02:00
Marc Pichler 432d43942e
chore(sdk-node): add notice to manually install '@opentelemetry/exporter-jaeger' (#4068)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-29 14:51:46 +02:00
Mend Renovate d8a14ea5b2
chore(deps): update all patch versions (#4087)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-29 14:45:34 +02:00
Mend Renovate 6e7df295bf
fix(deps): update dependency axios to v1.5.0 (#4089)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-29 14:44:46 +02:00
Aaron Abbott a793321c62
feat: update PeriodicExportingMetricReader and PrometheusExporter to accept optional metric producers (#4077)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-29 14:37:14 +02:00
Marc Pichler 0cc9a0b10b
fix(renovate): remove faulty '@types/node' rule and explicitly apply it to the whole repo (#4091) 2023-08-29 10:36:23 +02:00
Mend Renovate 8ac369f87e
chore(deps): update all patch versions (#4050) 2023-08-24 08:48:43 -04:00
Mend Renovate c230076c69
chore(deps): update dependency gh-pages to v6 (#4058) 2023-08-23 14:42:58 -04:00
Marc Pichler dfe9bdd32c
chore(deps): update prettier to v3 and prettier-plugin-eslint to v5 (#4075)
* chore(deps): update dependency prettier to v3

* chore: bump prettier-plugin-eslint and apply rules

---------

Co-authored-by: Mend Renovate <bot@renovateapp.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-23 14:36:11 -04:00
shashi3kiran3 863c4d4028
chore(sdk-node): deprecate methods in favor of constructor options (#3996) (#4076)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-23 14:14:50 -04:00
Daniel Dyla 92050b55ad
docs: fix broken link to renovate.json (#4085) 2023-08-23 12:01:51 -04:00
Haddas Bronfman f263ab7134
docs(guidelines): add dependencies guidelines (#4040)
* docs(guidelines): add dependencies guidelines

* docs(guidelines): add line to CHANGELOG

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* docs(guidelines): lint

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Update GUIDELINES.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>

* Move guidelines to doc directory

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-23 11:40:57 -04:00
Marc Pichler cd539dd2d0
chore: move inactive approvers to emeritus (#4069)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-23 11:28:55 -04:00
Mend Renovate 34660b5372
chore(deps): update dependency chromedriver to v116 (#4080) 2023-08-23 11:13:22 -04:00
Gabriel Poulenard-Talbot b400c2e5d9
fix(zipkin-exporter): round duration for zipkin (#4064)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-08-17 17:16:42 +02:00
Marc Pichler 5259a0b928
chore(sdk-node): deprecate methods in favor of constructor options (#3996) 2023-08-16 14:38:03 +02:00
Marc Pichler 853a7b6ede
fix(changelog): fix incorrect version for latest experimental release (#4047) 2023-08-13 12:08:59 +03:00
Amir Blum 902229afd8
chore: update blumamir employee name in the README (#4052)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-10 11:23:28 +02:00
Aaron Abbott d3436bfac5
feat(sdk-metrics): implement MetricProducer specification (#4007)
Co-authored-by: David Ashpole <dashpole@google.com>
2023-08-10 10:27:47 +02:00
Marc Pichler 48fb15862e
chore: prepare release 1.15.2/0.41.2 (#4036) 2023-08-08 14:59:06 +02:00
Mend Renovate ffe641c08c
chore(deps): update all patch versions (#4043) 2023-08-08 10:21:55 +02:00
Katherine a4213183b0
fix(parseKeyPairsIntoRecord): allow equals in baggage value #3974 (#3975)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-07 18:11:46 +02:00
Marc Pichler 3732256f02
docs(README): clarify browser support (#4037)
Co-authored-by: Patrice Chalin <chalin@users.noreply.github.com>
2023-08-07 17:14:30 +02:00
Hunter Paulson 5fd656bb08
docs(resources): Fixes detectResources deprecated typos (#4003)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-03 15:11:24 +02:00
Mend Renovate b4cda7a9db
chore(deps): update all patch versions (#3997) 2023-08-02 12:49:36 +02:00
Chengzhong Wu 4cffe5dfef
fix(sdk-metrics): ignore invalid metric values (#3988)
Co-authored-by: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com>
2023-08-01 17:16:07 +02:00
Marc Pichler 87fff2ece4
fix(instrumentation-grpc): instrument @grpc/grpc-js Client methods (#3804) 2023-08-01 16:12:40 +02:00
Aaron Abbott 1a7488ecdd
chore(exporter-logs-otlp-http): commit missing generated changes to tsconfig.json (#4032)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-08-01 15:21:01 +02:00
Marc Pichler 0755a5c076
fix(ci): don't collect coverage for eol tests (#4030) 2023-08-01 14:20:02 +02:00
Aaron Abbott c021b10b14
fix(core): stop rounding to nearest int in hrTimeTo*seconds() functions (#4014) 2023-07-31 14:14:12 +08:00
Nev 2b20565d10
fix: Add otel-api as dev dep for sandbox tests (#4020)
* fix: Add otel-api as dev dep for sandbox tests

* fix changelog formatting
2023-07-26 12:43:54 -04:00
Daniel Dyla 9f71800fdc
chore: prepare release 1.15.1/0.41.1 (#4016) 2023-07-24 09:44:44 -04:00
Daniel Dyla 0f20b2a974
Revert tslib #3914 (#4011)
* Revert "feat(minification): Add noEmitHelpers, importHelpers and tslib as a dependency (#3914)"

This reverts commit 74393ac639.

* Changelog

* Update CHANGELOG.md
2023-07-21 09:41:09 -04:00
Mend Renovate 87f21ef8ae
chore(deps): update dependency nock to v13.3.2 (#3994) 2023-07-14 12:49:00 +02:00
Mend Renovate 65483a4fe9
chore(deps): update all patch versions (#3984) 2023-07-13 15:49:25 +02:00
Chengzhong Wu 5352cc78b6
chore: apply update-ts-configs (#3987) 2023-07-13 12:58:25 +02:00
Marc Pichler 013695d45d
docs(api-logs): add disclaimers (#3979) 2023-07-11 08:51:11 +02:00
Pushpak Prateek 552abc8221
feat(sdk-node): logs support added (#3969) 2023-07-10 18:55:53 +02:00
Jamie Danielson fc28665d09
docs(sdk-metrics): add example of exponential histogram metric (#3855)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-07-10 17:31:57 +02:00
Mend Renovate 6d13eb4379
chore(deps): update dependency semver to v7.5.4 (#3977) 2023-07-10 10:36:44 +02:00
Mend Renovate cab31aadb1
chore(deps): update all patch versions (#3972) 2023-07-07 10:10:00 +02:00
Mend Renovate 68039c55ec
chore(deps): update dependency eslint to v8.44.0 (#3916) 2023-07-06 15:27:02 +02:00
Marc Pichler b34c39bf32
chore(deps): update dependency eslint to v8.43.0 (#3929)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2023-07-06 15:14:56 +02:00
Marc Pichler 02c1d95608
chore: replace istanbul-instrumenter-loader with maintained component (#3918) 2023-07-06 15:06:00 +02:00
Marc Pichler 06e919d6c9
chore: prepare release 1.15 / 0.41 (#3963) 2023-07-06 13:06:26 +02:00
Mend Renovate a675ae817b
chore(deps): update all patch versions to v7.22.6 (#3965) 2023-07-05 11:21:20 +02:00
Abinet18 ea160d9c5c
fix: add secureConnectionStart to https only (#3879)
Co-authored-by: t2t2 <taavot@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-07-05 10:29:28 +02:00
粒粒橙 dccd90603b
chore(instrumentation-grpc): cleanup remnants of grpc-native support (#3886) 2023-07-04 17:25:43 +02:00
Marc Pichler c51c9eb954
docs(otlp-exporters): update docs to reflect OTLP 0.20.0 is used (#3938)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2023-07-04 15:23:08 +02:00
Mend Renovate de5cd0f409
fix(deps): update dependency import-in-the-middle to v1.4.1 (#3962) 2023-07-03 14:25:58 +02:00
Jackson Weber 1ce8a899cf
Update the Prometheus Exporter to by Default not Append Timestamp (#3961) 2023-07-03 13:34:35 +02:00
Martin Kuba 070b6852a5
LowMemory metrics temporality preference (#3915)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-30 11:13:03 -07:00
Andreas Odysseos bb8a4f7ab7
fix(http-intrumentation): prevent request socket null from throwing uncaught error (#3858)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-29 14:59:09 +02:00
Mend Renovate b3d57bb295
chore(deps): update lerna monorepo to v7.1.1 (#3956) 2023-06-29 08:49:38 +02:00
Aaron Abbott e2e291c583
fix(sdk-metrics): preserve startTime for cumulative ExponentialHistograms (#3934)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-29 08:31:08 +02:00
Marc Pichler 10c3e934cc
fix(selenium-tests): restore tests to functional state (#3923) 2023-06-27 07:08:03 +02:00
粒粒橙 15ede4700b
fix(example-opencensus-shim): avoid OpenCensus auto instrumentations (#3951)
* fix(example-opencensus-shim): avoid opencensus instrumentations being auto imported

* chore: changelog

---------

Co-authored-by: Haddas Bronfman <85441461+haddasbronfman@users.noreply.github.com>
2023-06-26 15:20:53 +03:00
Marc Pichler 4dc8416f9e
fix(exporter-logs-otlp-http): update tsconfigs (#3936) 2023-06-26 11:04:48 +02:00
Mend Renovate a30952cc50
chore(deps): update dependency nightwatch to v3 (#3950) 2023-06-26 10:35:45 +03:00
Mend Renovate 655e373c53
chore(deps): update dependency semver to v7.5.3 (#3942) 2023-06-23 06:55:45 +02:00
Marc Pichler 9977de7924
fix(otlp-proto-exporter-base): add missing type import (#3937) 2023-06-22 16:06:59 +02:00
Marc Pichler 19fb033900
feat(otlp-exporters): bump otlp proto to 0.20.0 (#3932) 2023-06-21 20:26:54 +02:00
Nicolas Hansse 5dc0f6974a
fix(exporter-logs-otlp-http): set useHex to true (#3875) 2023-06-21 14:16:16 +02:00
Nev 74393ac639
feat(minification): Add noEmitHelpers, importHelpers and tslib as a dependency (#3914)
* feat(minification): Add noEmitHelpers, importHelpers and tslib as a dependency

* fix: Lint fixes

* Remove noEmitHelpers as not needed

---------

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2023-06-20 19:30:36 +08:00
Mend Renovate 196b6442b9
chore(deps): update dependency markdownlint-cli to v0.35.0 (#3928)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-20 13:11:24 +02:00
粒粒橙 f40e3de178
feat(otlp-grpc-exporters): Add support for Unix domain socket endpoints. (#3853)
* feat(otlp-grpc-exporter-base): add support for unix domain socket

* test(otlp-grpc-exporter): add tests

* chore(docs): update docs and changelog

* fix: skip UDS tests on windows

* Update CHANGELOG.md

* fix: add protocol to http test urls

* fix: update tests

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2023-06-20 18:32:33 +08:00
Marc Pichler 67d4b80665
chore: bump lerna to 7.0.2, add @lerna/legacy-package-management (#3926) 2023-06-20 17:57:51 +08:00
Marc Pichler 5bee444ab6
chore: fix misaligned dependency versions (#3924)
* chore: fix misaligned dependency versions

* chore(otlp-transformer): remove sdk-logs devDependency
2023-06-20 11:29:28 +08:00
Mend Renovate d76f34eef2
chore(deps): update dependency semver to v7.5.2 (#3919) 2023-06-19 11:31:30 +02:00
Mend Renovate dfe6fe8272
chore(deps): update dependency lerna to v6.6.2 (#3885) 2023-06-16 12:51:35 +02:00
Marc Pichler e8f3432bde
chore: add lerna to devDependencies in all packages (#3909) 2023-06-16 12:37:29 +02:00
Mend Renovate 4b2d887cd5
chore(deps): update dependency karma to v6.4.2 (#3911) 2023-06-15 11:18:45 +02:00
Mend Renovate c981558b50
chore(deps): update typescript-eslint monorepo to v5.59.11 (#3910) 2023-06-14 17:48:01 +02:00
Mend Renovate 51fb576c16
chore(deps): update dependency webpack-cli to v4.10.0 (#3907) 2023-06-14 17:28:49 +02:00
Mend Renovate 661b2831e4
chore(deps): update dependency markdownlint-cli to v0.34.0 (#3906)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-14 16:40:01 +02:00
Aaron Abbott 5912501043
docs(opencensus-shim) add an example showing how to use the opencensus shim (#3778)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-14 16:39:12 +02:00
Mend Renovate b7d2fac77d
chore(deps): update dependency webpack-merge to v5.9.0 (#3904) 2023-06-14 15:12:09 +02:00
Marc Pichler fbb7d72feb
chore(deps): update dependency prettier to v2.8.8 (#3905)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2023-06-14 14:18:20 +02:00
Mend Renovate 5288753c21
chore(deps): update dependency sinon to v15.1.2 (#3900) 2023-06-14 09:06:07 +02:00
Mend Renovate 4bed3c92ff
chore(deps): update dependency dpdm to v3.13.1 (#3898) 2023-06-14 08:41:02 +02:00
Mend Renovate 4f440aa342
chore(deps): update dependency babel-loader to v8.3.0 (#3897) 2023-06-14 08:12:00 +02:00
Mend Renovate 863c8a4081
chore(deps): update dependency @types/semver to v7.5.0 (#3895) 2023-06-14 07:55:54 +02:00
Mend Renovate 65fa45fdef
chore(deps): update babel monorepo (#3891) 2023-06-14 07:10:12 +02:00
Chi Ma 5a1cd99bae
fix(sdk-metrics): Update default Histogram's boundary to match OTEL's spec (#3893) 2023-06-13 16:44:43 +02:00
Mend Renovate 95a5e0cada
chore(deps): update dependency unionfs to v4.5.1 (#3890) 2023-06-13 08:16:47 +02:00
Mend Renovate 75691c92cd
chore(deps): update dependency protobufjs-cli to v1.1.1 (#3889) 2023-06-13 07:50:32 +02:00
Mend Renovate f606404cd7
chore(deps): update dependency memfs to v3.5.3 (#3888) 2023-06-13 07:27:15 +02:00
Mend Renovate 2f472adb93
chore(deps): update dependency chromedriver to v114 (#3849) 2023-06-13 06:55:03 +02:00
Mend Renovate 7fc17e5c45
chore(deps): update actions/checkout action to v3.5.3 (#3883) 2023-06-12 14:36:31 +02:00
Mend Renovate 630e0da2dc
chore(deps): update dependency nock to v13.3.1 (#3884) 2023-06-12 14:05:04 +02:00
粒粒橙 3b387d8f37
fix: align dependency versions (#3847)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-12 13:20:02 +02:00
粒粒橙 e8540c5016
chore(instrumentation-grpc): drop support for `grpc` (#3807)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-06-12 13:10:12 +02:00
粒粒橙 4a7091f2b4
fix(npm-scripts): support windows platform using `cross-var` (#3857) 2023-06-11 01:22:09 +08:00
粒粒橙 228e67b941
chore(otlp-grpc-exporter): update TLS certs and keys for tests (#3878)
* chore(otlp-grpc-exporter): remove unused certs

* chore(otlp-grpc-exporter): update TLS certs and keys for tests
2023-06-08 13:16:38 -04:00
Mend Renovate 51dd6f2ddd
chore(deps): update all patch versions (#3874) 2023-06-08 12:45:34 +03:00
Mend Renovate a2ff4b677d
chore(deps): update dependency mocha to v10.2.0 (#3873) 2023-06-08 10:10:17 +08:00
Marc Pichler 3d7015121c
chore(renovate): improve PR grouping and add @pichlermarc to assignees (#3868)
* chore(renovate): improve PR grouping and add @pichlermarc to assingees

* chore: fix 'compatability' typo
2023-06-07 16:29:39 -04:00
Chengzhong Wu 69da5d548e
chore(deps): update dependency linkinator to v5 (#3866)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-07 09:52:13 +02:00
Marc Pichler edebbcc757
chore: prepare release 1.14 / 0.40 (#3854)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-06-06 07:13:04 +02:00
Abinet18 1fc4ac652f
feat(exporter-logs-otlp-proto): implements protobuf exporter for logs (#3779)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-02 09:58:44 +02:00
粒粒橙 05bcd822a9
fix: missing `entryPoints` in tsconfig.json (#3846)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-02 08:18:27 +02:00
Abinet18 8eb9bf30a3
feat/logattributes support map type (#3821)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-06-02 07:23:06 +02:00
Marc Pichler a4f0b42f1e
fix(exporter-logs-otlp-grpc): make test server use port 1503 (#3842) 2023-05-31 15:54:39 +02:00
Aaron Abbott 622955a95d
feat(opencensus-shim) add require-in-the-middle hook to patch @opencensus/core (#3809) 2023-05-31 07:54:13 +02:00
Jorge Padilla a8ac8baa51
fix(semantic-conventions): update trace semantic conventions url (#3843) 2023-05-30 08:53:32 +02:00
Marc Pichler 2fb1b3064e
chore(instrumentation-grpc): add 'grpc' deprecation notice postinstall script (#3833) 2023-05-26 21:28:00 +02:00
Marc Pichler 0c12777c98
deps(exporter-logs-otlp-http): remove unused rimraf devDependency (#3840) 2023-05-26 09:11:53 +02:00
Marc Pichler 73d7b6735b
fix(exporter-logs-otlp-http): bump version to 0.39.1 (#3836) 2023-05-25 17:01:14 +02:00
fuaiyi fe82d7b005
feat(exporter-logs-otlp-http): implements otlp-http exporter for logs (#3764)
* feat(exporter-logs-otlp-http): implements otlp-http exporter for logs

* feat(exporter-logs-otlp-http): improve README

* feat(exporter-logs-otlp-http): add browser section in package.json

* feat(exporter-logs-otlp-http): update log-sdk version

* feat(logs-exporter-otlp-http): update version of @opentelemetry/core

* feat(exporter-logs-otlp-http): update README

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-25 16:16:47 +02:00
Daniel Dyla c6635fa496
Add Purvi to approvers (#3832) 2023-05-24 12:22:28 -04:00
Daniel Dyla a6635428a9
Add Hector to approvers (#3831) 2023-05-24 12:22:02 -04:00
Daniel Dyla 5fb44c0447
Add Jamie to approvers (#3830) 2023-05-24 12:21:22 -04:00
Hector Hernandez 58dbbb4b89
[sdk-logs] remove includeTraceContext configuration and use LogRecord context when available (#3817)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-23 11:42:16 +02:00
fuaiyi 0471c54a4c
fix(exporter-logs-otlp-grpc): change OTLPLogsExporter to OTLPLogExpo… (#3819) 2023-05-22 10:48:37 +02:00
粒粒橙 de22983c50
feat(api-logs): add `ObservedTimestamp` to `LogRecord` (#3787)
* feat(api-logs): add `ObservedTimestamp` to `LogRecord`

* chore(changelog): add changelog

* fix(sdk-logs): use `Date` instead of `hrTime()` for timestamps

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-19 15:13:37 -04:00
Mend Renovate 9fe1f7d8d5
chore(deps): update dependency chromedriver to v113 (#3822) 2023-05-19 14:30:03 -04:00
Daniel Dyla d4a41bd815
Add scripts to prepare releases automatically (#3805) 2023-05-17 23:11:03 +02:00
Jackson Weber fcd75dfda8
feat(opentelemetry-sdk-trace-base): Add optional forceFlush property to SpanExporter interface (#3753)
* feat(opentelemetry-sdk-trace-base): Add optional forceFlush property to SpanExporter interface

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>

* feat(opentelemetry-sdk-trace-base): fixup changelog

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>

* feat(opentelemetry-sdk-trace-base): fixup changelog

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>

* feat(opentelemetry-sdk-trace-base): add exporter forceflush functions

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>

* feat(opentelemetry-sdk-trace-base): add tests, add empty implemtation for downstream exporters

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>

* feat(opentelemetry-sdk-trace-base): add implementation for forceflush for zipkin, jaeger, otlp

* feat(opentelemetry-sdk-trace-base): fix lint, minor review change

* feat(opentelemetry-sdk-trace-base): minor review change

* feat(opentelemetry-sdk-trace-base): fix lint

* feat(opentelemetry-sdk-trace-base): minor change

* Fix lint.

* Have the SimpleSpanProcessor handle force flush.

* Update changelog.

* Update the span processor to call forceFlush in the exporter.

* Fix lint.

* Make the forceFlush method optional.

* fix(changelog): replace mandatory -> optional

* Add or update the Azure App Service build and deployment workflow config

* Delete issue_3067_jacksonweber-test-github.yml

* Add comment for ignoring resolved values.

---------

Signed-off-by: Sidartha Gracias <sgracias@cisco.com>
Co-authored-by: Sidartha Gracias <sgracias@cisco.com>
Co-authored-by: Sidartha Gracias <97981532+sgracias1@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-17 16:07:26 -04:00
Mend Renovate 17eca4c792
fix(deps): update dependency require-in-the-middle to v7 (#3782)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-17 11:57:17 -04:00
Aaron Abbott 18ea3df2b7
chore(changelog): combine accidental multiple enhancement sections into one (#3815) 2023-05-17 11:56:23 -04:00
Mend Renovate c3feabe4e7
fix(deps): update dependency axios to v1 (#3299)
* fix(deps): update dependency axios to v1

* fix(deps): update dependency axios to v1

* Fix types

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-17 10:06:12 -04:00
Mend Renovate 81ee1df218
chore(deps): update node.js to v20 (#3768)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-17 09:18:40 -04:00
Jamie Danielson 6a876a053f
feat(otlp-metric-exporters): Add User-Agent header to OTLP metric exporters (#3806)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-17 07:22:27 +02:00
Aaron Abbott 68eba71191
feat(opencensus-shim) add ShimTracer and ShimSpan implementations (#3756)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-16 08:01:38 +02:00
Amir Blum 2531263948
fix(sdk-node): use resource interface instead of concrete class (#3803) 2023-05-15 20:38:44 +02:00
Jamie Danielson 758c7af0c1
feat(otlp-trace-exporters): Add User-Agent header to OTLP trace exporters (#3790)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-15 11:14:12 +02:00
Jamie Danielson 422a36ae12
feat: ESM support for instrumentation (#3698)
Co-authored-by: Purvi Kanal <kanal.purvi@gmail.com>
Co-authored-by: Jamie Danielson <jamieedanielson@gmail.com>
Co-authored-by: Liz Fong-Jones <lizf@honeycomb.io>
Co-authored-by: Purvi Kanal <purvikanal@honeycomb.io>
2023-05-15 10:30:52 +02:00
Marc Pichler bba09c0e5a
chore: release 0.39.1 (#3800) 2023-05-12 15:01:36 +02:00
Marc Pichler 29c46ef5ce
fix(otlp-transformer): move api-logs to dependencies (#3798) 2023-05-12 11:12:42 +02:00
Marc Pichler 8fc7689659
chore: release 1.13 / 0.39 (#3776) 2023-05-11 15:08:45 +02:00
Gerhard Stöbich 32632bd303
doc(instrumentation): add limitiations section to readme (#3786)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-05-11 10:21:23 +02:00
Aaron Abbott b8b6308386
chore: remove "opentelemetry" prefix from opencensus-shim package directory (#3784) 2023-05-09 07:04:46 +02:00
Aaron Abbott 7255da994f
feat(opencensus-shim) add mapping logic and propagation shim (#3751) 2023-05-05 08:16:46 +02:00
Trent Mick 32ae641ad1
fix(deps): update dependency require-in-the-middle to v7.1.0 for types and named export (#3727)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-05-02 09:43:13 +02:00
Marc Pichler 2f1e316484
feat(otlp-grpc-exporter-base): use statically generated protobuf code (#3705)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-04-28 12:58:20 +02:00
粒粒橙 abfb1bb68e
refactor(otlp-transformer): refine metrics transformer (#3770) 2023-04-28 12:28:52 +02:00
粒粒橙 a96116db88
deps: remove `rimraf` (#3769) 2023-04-28 10:25:32 +02:00
粒粒橙 98e4e821bc
feat(exporter-logs-otlp-grpc): implements otlp-grpc exporters for logs (#3712)
Co-authored-by: Martin Kuba <martin@martinkuba.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-04-26 11:05:21 +02:00
Simen Bekkhus 9347ca6a3e
fix(http): stop listening to `request`'s `close` event once it has emitted `response` (#3625)
Co-authored-by: Chengzhong Wu <chengzhong.wcz@alibaba-inc.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-04-26 15:41:43 +08:00
Aaron Abbott 6676414505
feat(opencensus-shim): add OpenCensus shim package boilerplate (#3750)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-04-25 07:11:38 +02:00
Marc Pichler cd0d8806e0
fix(sdk-node): lazy require @opentelemetry/exporter-jaeger (#3739)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-04-24 10:55:57 +02:00
Martin Kuba de354dbbdd
fix: VisibilityState type for typescript >4.6 (#3741)
Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
2023-04-20 11:02:52 +02:00
Daniel Dyla 61aae103f3
Fix changelog link (#3744) 2023-04-19 11:32:12 +02:00
Trent Mick 3e99e13a4e
fix(instrumentation): update dep require-in-the-middle to 7.0.1 (#3743) 2023-04-19 10:08:07 +02:00
Marc Pichler 1b50f91850
deps(sdk-logs): remove unused rimraf dev dependency (#3738) 2023-04-18 10:23:32 +02:00
Marc Pichler 5b9534bd47
deps: remove unused mkdirp and rimraf dependencies (#3737) 2023-04-18 06:50:54 +02:00
Daniel Dyla 053acb604c
Logs version fixup (#3729)
* Logs version fixup

* Fix changelog

* Fix changelog
2023-04-13 15:35:23 -04:00
Daniel Dyla a04090010e
chore: release proposal 1.12 / 0.38 (#3725)
* chore: release proposal 1.12 / 0.38

* changelog

* lint
2023-04-13 12:39:56 -04:00
fuaiyi a31b38a845
Logs SDK (#3549)
* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* fix compile errors

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): sdk-logs init

* feat(sdk-logs): add browser test config

* feat: add test-utils compatible assert.rejects

* feat(sdk-logs): fix writing errors in README

* feat(sdk-logs): update version to 0.36.1

* feat(sdk-logs): add examples

* feat(sdk-logs): fix LogRecord default timestamp to Date.now()

* feat(sdk-logs): logRecord support rewrite time/body/severityNumber/newSeverityText

* feat(sdk-logs): add logs processor environments

* feat(sdk-logs): modify export style

* feat(sdk-logs): update version to 0.36.1

* feat(sdk-logs): remove exporter factory

* feat(sdk-logs): update CHANGELOG

* feat(sdk-logs): change the processing of schemeUrl

* feat(sdk-logs): split LoggerProviderConfig and LoggerConfig

* feat(sdk-logs): getLogger with default name  when name is invalid

* feat(sdk-logs): improve the shutdown logic of LoggerProvider

* feat(sdk-logs): improve the shutdown logic of LoggerProvider

* feat(sdk-logs): make log record read-only after it has been emitted

* feat(sdk-logs): logger option support includeTraceContext & LogRecordProcessor onEmit suport context

* feat(sdk-logs): update version

* feat(sdk-logs): update version

* feat(sdk-logs): update logs example with typescript

* feat(sdk-logs): update peerDependencies

* feat(sdk-logs): peer-api-check support @opentelemetry/api-logs

* feat(sdk-logs): update peerDependencies

---------

Co-authored-by: Martin Kuba <martin@martinkuba.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-04-13 08:41:19 -04:00
Marc Pichler 26dfc70841
fix(sdk-node)!: remove unused defaultAttributes option (#3724) 2023-04-13 11:31:29 +02:00
Grunet 9945c4bb14
fix(opentelemetry-sdk-trace-web): don't crash in runtimes where location isn't defined (#3715)
* fix(opentelemetry-sdk-trace-web): don't crash in runtimes where location isn't defined

* chore: updated changelog

* chore(opentelemetry-sdk-trace-web): fix linter issues

* fix(opentelemetry-sdk-trace-web): Remove broken test and replace with comment

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-04-12 11:44:20 -04:00
Mend Renovate 93285585ce
chore(deps): update dependency chromedriver to v112 (#3718) 2023-04-07 13:52:27 -04:00
Daniel Dyla 65b2b79b13
Log name and ID on span end misuse (#3716)
* Log name and ID on span end misuse

* Changelog

* lint
2023-04-05 13:56:56 -04:00
Pierre Tessier 73da976982
fix(instrumentation-http): use semantic convention metric descriptions (#3710) 2023-04-04 11:27:53 +02:00
Valentin Marchaud 4b04407ba3
chore: move vmarchaud to emeriti (#3709) 2023-03-31 15:47:30 -04:00
Rauno Viskus b8923d5165
chore: emeritify Rauno56 🎉 (#3706)
* chore: emeritify Rauno56 🎉

* chore: add changelog entry

* chore: remove myself from the renovate assignees
2023-03-30 11:28:40 -04:00
Daniel Dyla 1328ee04ae
Prepare version 1.11.0 and 0.37.0 (#3695)
* Prepare version 1.11.0 and 0.37.0

* Add accidentally removed changelog entry

* fix: add API package back to lerna linked packages

* fix(changelog): move misplaced entries

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-30 09:41:01 -04:00
Mend Renovate 9a79db3e18
chore(deps): update actions/stale action to v8 (#3699) 2023-03-28 15:40:34 -04:00
Simen Bekkhus dc94696d5a
chore: remove handling of node versions 8, 9 and 10 in tests (#3696)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-28 08:01:33 +02:00
Matthew Wear 8c788590f7
feat: exponential histogram - part 3 - export (#3506) 2023-03-28 07:11:39 +02:00
Marc Pichler dbe005f548
fix(ci): use npx to run tsc 4.4.4 in api-eol-node-test (#3700) 2023-03-28 06:58:12 +02:00
Marc Pichler 0c37daa0b1
fix(sdk-node): only set DiagConsoleLogger when OTEL_LOG_LEVEL is set (#3693) 2023-03-23 12:59:48 +01:00
Daniel Dyla ca700c4eef
Merge v1.10.1 changelog/version updates (#3692) 2023-03-20 15:25:47 -04:00
Daniel Dyla 823f846ebf
chore: move changelog entry to unreleased section (#3687)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-20 09:35:15 -04:00
Craig Rodrigues 80c53a9637
docs: fix links to OpenTelemetry Metrics documentation (#3691)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-20 11:20:34 +01:00
Hongbo Miao c4a8387cb4
docs(readme): exporter should be metricExporter (#3688) 2023-03-20 11:08:50 +01:00
Mend Renovate 25bb985342
chore(deps): update actions/stale action to v7 (#3507)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-17 16:34:21 -04:00
Matthew Wear c5c54acc0f
feat: collect additional process attributes (#3605)
* refactor: move ProcessDetector to node; export noopDetector for Browser

* feat: collect additional process attributes

* refactor: always return a process resource

This commit introduces a slight change in behavior. Previously the
ProcessDectector would validate that it received attributes that it
expected, and returned an empty Resource if it didn't. Based on the
types, and the implementation of the ProcessDetector, there will
always be a valid ProcessResource. Collection of many of the attributes
can be done as a best effort without violating the specification.

* chore: add changelog entry

* feat: collect process.execArgv in process.command_args

* refactor: omit process.command_line in favor of process.command_args

* Move changelog entry to unreleased

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-17 16:29:10 -04:00
Domas 18ad56fedc
fix(sdk-trace-web): make parseUrl respect document.baseURI (#3670)
* fix parseUrl to handle baseurl override for relative urls

* tests

* lint fixes

* add changelog entry

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-17 15:57:29 -04:00
Julien Fabre 52facfa5b1
fix!: span name on instrumentation-xml-http-request (#3672)
* fix: remove HTTP in span name

* fix: add entry in CHANGELOG.md

* fix: add breaking change changelog

* Update experimental/packages/opentelemetry-instrumentation-xml-http-request/src/xhr.ts

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>

* Remove duplicate changelog entry

---------

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-17 14:55:21 -04:00
Mend Renovate 89a984a182
chore(deps): update dependency chromedriver to v111 (#3685)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-17 14:40:56 -04:00
Martin Kuba 7e9ff249ac
docs: updated example in README to match updated start method (#3684) 2023-03-17 10:03:49 -04:00
Marc Pichler a96e429b31
fix(resources): change fs/promises import to be node 12 compatible (#3681)
* fix(resources): change fs/promises import to be node 12 compatible

* fix(changelog): add changelog entry.
2023-03-16 17:20:44 -04:00
Marc Pichler 9a37fafb4c
fix(resource): make properties for async resource resolution optional (#3677)
* fix(resource): make properties for async resolution optional

* fix(changelog): add changelog

* fix(resources): add regression test

* fix(resources): remove ts-ignore in tests

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-16 08:38:44 -04:00
Daniel Dyla 3653f5cbf3
docs: update CONTRIBUTING.md merge requirements (#3671)
* docs: update CONTRIBUTING.md

* lint: spacing
2023-03-15 16:31:20 -04:00
Chengzhong Wu 2276977218
fix(sdk-metrics): merge uncollected delta accumulations (#3667)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-15 00:46:04 +08:00
Matthew Wear d82a0983c1
feat: exponential histogram - part 2 - the accumulation and aggregator (#3505) 2023-03-14 16:07:33 +01:00
Daniel Dyla 56e6b1bb89
chore: Release API 1.4.1, SDK 1.10.0, Experimental 0.36.0 (#3654)
* chore: Release API 1.4.1, SDK 1.10.0, Experimental 0.36.0

* Experimental changelog

* Fix API dependency
2023-03-13 11:12:25 -04:00
Nev ecb5ebe86e
fix: Minor typing issues for web sandbox (#3660) 2023-03-08 18:40:19 +01:00
Mohit Karekar 48ecf229eb
feat(sdk-trace-base): add dropped attributes and events count on span (#3576)
* feat(sdk-trace-base): add dropped attributes and events count on span

* feat(sdk-trace-base): sync with main

* feat(sdk-trace-base): [revert] sync with main

* feat(sdk-trace-base): fix tests, make both counts truthy

* feat(sdk-trace-base): Update dropped counts type to number

* feat(sdk-trace-base): Use exposed counts on ReadableSpan in jaeger and zipkin exporters

* feat(sdk-trace-base): WIP - revert tsconfig, add new attribute limits

* feat(sdk-trace-base): Update attribute truncate method

* Fix bad conflict resolution

* Remove unused import

* chore: lint

* feat(sdk-trace-base): Remove dropped event attributes logic, add Jaeger field

* feat(sdk-trace-base): Undo formatting in changelog

* fix(changelog): Update experimental changelog

* Update packages/opentelemetry-sdk-trace-base/src/Span.ts

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>

* Update packages/opentelemetry-sdk-trace-base/src/Span.ts

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>

* fix(sdk-trace-base): Resolve review comments

* fix(sdk-trace-base): Fix failing tests

* fix(sdk-trace-base): make droppedAttributesCount on event optional

* fix(changelog): Update changelog files

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2023-03-08 11:47:04 +08:00
粒粒橙 95bf6fc7cc
fix(build): add `example/http` to ignore list in `update-ts-configs` (#3657) 2023-03-07 10:23:23 +01:00
Julian Labatut 3a2ca58075
feat: add unit to view instrument selection criteria (#3647)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2023-03-06 16:38:59 +01:00
Marc Pichler ebc8575a0c
chore(jeager-exporter): deprecate jaeger exporter (#3585)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-06 06:48:08 +01:00
Xavier Serrano 2f715bd78d
feat: allow to add attributes from grpc metadata in the patched server (#3589)
* feat(opentelemetry-instrumentation-grpc): support server calls in metadataToSpanAttributes

Signed-off-by: Xavier Serrano <zombispormedio007@gmail.com>

* chore(opentelemetry-instrumentation-grpc): update changelog

Signed-off-by: Xavier Serrano <zombispormedio007@gmail.com>

* chore(opentelemetry-instrumentation-grpc): update changelog

* chore(opentelemetry-instrumentation-grpc): update comments and documentation

Signed-off-by: Xavier Serrano <zombispormedio007@gmail.com>

---------

Signed-off-by: Xavier Serrano <zombispormedio007@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-03 08:16:30 -05:00
Marc Pichler cbbdfd3798
fix(sdk-node): update instrumentations once MeterProvider is initialized (#3624)
* fix(sdk-node): provide workaround for broken metrics instrumentation registration

* fix(changelog): add changelog entry

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-02 09:46:14 -05:00
Jamie Danielson 4a4484a910
chore: update http example (#3651)
* update versions in http example

* use newer active span methods for http example

* fix(changelog): add changelog entry

* Add http example to lerna

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-02 09:36:24 -05:00
Svetlana Brennan 494efffcf4
fix(otlp-exporter-base): fix changelog for merged retry pr (#3650) 2023-03-02 14:31:34 +01:00
Haddas Bronfman 0fb78797ed
feat(sdk-node): override IdGenerator when using NodeSDK (#3645) 2023-03-02 14:01:21 +01:00
Altinok Darici 6f3e96fd77
Export DiagLoggerOptions Type (#3639) 2023-03-02 13:45:58 +01:00
Altinok Darici 31dd7b7258
Rename Diag/LoggerOptions to DiagLoggerOptions (#3641)
* Rename LoggerOptions to DiagLoggerOptions

* Change log

---------

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-03-01 16:53:13 -05:00
kobi-co a457d941c2
fix(instrumentation-http): include query params in http.target (#3646)
* fix: set http.target as path (like spec) and not pathname

* fix: set http.target as path (like spec) and not pathname

* fix: set http.target as path (like spec) and not pathname
2023-03-01 16:38:13 -05:00
Marc Pichler 74ca04f7b2
fix(test): fix failing tests by preventing source-map generation (#3642)
* fix(test): fix excessive memory usage by preventing source-map generation

* fix(changlog): add changelog entry.
2023-03-01 16:42:01 +08:00
Matthew Wear 0d373bd8b0
feat: detect host id for non-cloud environments (#3575) 2023-03-01 06:59:10 +01:00
Gerhard Stöbich 79b06a470a
feat: improve http span name (#3603) 2023-02-28 18:08:07 +01:00
Svetlana Brennan abfe059d72
feat(otlp-exporter-base): add retries (#3207)
* feat(otlp-exporter-base): add retries to sendWithHttp

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add tests and update abort logic

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add retry test

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add retry to browser exporter and add tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): refactor

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add jitter

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): initialize reqIsDestroyed to false

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add throttle logic

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add retry to readme

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): add changelog

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): update throttle time function

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): refactor sec difference in throttle fun

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): refactor retrieve throttle time func

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(otlp-exporter-base): move parseRetryAfterToMills to utils file

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

---------

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2023-02-28 13:11:08 +08:00
Nev 708afd0e9e
fix: batchspanprocessor.test for TS > 4.6.0 (#3636) 2023-02-27 16:38:46 -05:00
ravindra-dyte 7f63a6fa5e
fix(core): added falsy check to make otel core work with browser where webpack config had process as false or null (#3617)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-27 11:42:37 +01:00
Mend Renovate 1fbc828607
chore(deps): update dependency chromedriver to v110 (#3600) 2023-02-24 13:56:29 -05:00
John Bley 99524a10fb
chore: improve logging for api registration mismatches (#3629)
* chore: improve logging for api registration mismatches

* chore: Update api/src/internal/global-utils.ts

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-22 11:26:16 -05:00
Simen Bekkhus b73ba9c398
chore: remove unused argument (#3626)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-22 09:35:50 -05:00
Chengzhong Wu 9b4f2a516d
feat(sdk-node): install diag log with OTEL_LOG_LEVEL (#3627) 2023-02-22 08:26:04 -05:00
Marcus Griep 86973eb79b
feat(sdk-trace-base): add diagnostic logging when spans are dropped (#3610) 2023-02-22 14:19:30 +08:00
Sami Musallam 47444f2a4c
feat(resource): create sync resource with some attributes that resolve asynchronously (#3460)
Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-14 01:52:09 +08:00
Chengzhong Wu 3bc080731d
chore: enable merge queue checks (#3607) 2023-02-13 22:55:44 +08:00
Daniel Dyla 2c51cc26d1
chore: enable merge queues (#3599) 2023-02-10 12:02:28 -05:00
Aleksei Androsov 326fd557cb
perf(propagator-jaeger): improve deserializeSpanContext performance (#3541) 2023-02-10 07:40:55 -05:00
Daniel Dyla d1aa906889
Add pichlermarc to maintainers (#3596) 2023-02-09 13:10:29 -05:00
Hermógenes Ferreira e0d6e14bfd
feat: add HTTP_ROUTE attribute to http incoming metrics if present (#3581)
* feat: add HTTP_ROUTE attribute to http incoming metrics if present

* fix: lint errors

* docs: add changelog entry

* fix: test name

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>

---------

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2023-02-09 09:03:00 -05:00
Raphaël Thériault 65e83d4f0a
feat: support TraceState in SamplingResult (#3530)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2023-02-09 16:34:25 +08:00
Amir Blum c32a845726
Add haddasbronfman as approver (#3593)
* Add haddasbronfman as approver

* Delete performance.ts

delete unrelated file

* remove unrelated file

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-08 14:40:19 -05:00
Daniel Dyla cb88e4ea11
Add martin kuba to approvers list (#3594) 2023-02-08 12:32:59 -05:00
Marc Pichler dd2af92054
fix(prometheus-exporter): add possibility to respond to errors returned by `server.listen()` (#3552) 2023-02-08 07:35:42 -05:00
Martin Kuba 92fbec99ec
Separate Events API from Logs API (#3550)
* added events API package

* removed events from Logs API

* updated logs tests

* added tooling and tests to api-events

* fixed package name, updated changelog, updated tsconfig

* lint

* added back precompile script, minor updates

* tsconfig updates

* changed logger to emitter in a test

* added domain as a required parameter for creating an emitter, removed from Event

* lint

* Update experimental/packages/api-events/package.json

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2023-02-07 13:23:05 -05:00
Mend Renovate ae3b4282f8
fix(deps): update dependency require-in-the-middle to v6 (#3584)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-02-07 10:53:12 -05:00
Marc Pichler 461dc4ba9e
fix(sdk-metrics): fix flaky LastValueAggregator test by using fake timer (#3587)
* fix(sdk-metrics): fix flaky LastValueAggregator test by using fake timers

* fix(changelog): add changelog entry.

* fix(sdk-metrics): change LastValueAggregation timer increment to 100ms
2023-02-06 16:55:01 -05:00
Chengzhong Wu 2b59c2820c
chore(tsconfig): abort on invalid json content (#3578)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-31 15:11:08 -05:00
Chengzhong Wu 2a76d881e4
feat(sdk-metrics): apply binary search in histogram (#3539) 2023-01-31 14:45:49 +08:00
Daniel Dyla 279458e7dd
Release 1.9.1 / 0.35.1 (#3573)
* Release 1.9.1 / 0.35.1

* clean up unreleased changelog
2023-01-30 08:43:13 -05:00
Marcin Jahn 49787433b6
fix(http): remove outgoing headers normalization (#3557)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2023-01-30 14:51:52 +08:00
Mend Renovate d1f9594d0c
chore(deps): update dependency rimraf to v4 (#3532)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-27 16:49:12 -05:00
Gerhard Stöbich e0abcc0b3f
fix: remove JSON syntax error and regenerate tsconfig files (#3566)
* chore: regenerate tsconfig files

* fix: add generated js files back to proto base esnext

* Changelog

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-27 12:59:50 -05:00
Gerhard Stöbich a90c558772
fix(sdk-node): register instrumentations early (#3502)
* fix(sdk-node): register instrumentations early

Register instrumentations as first step in start() before it gets async to
ensure that modules required during async resource detection get instrumented.

* Update experimental/CHANGELOG.md

---------

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-27 12:58:41 -05:00
Gerhard Stöbich 5b070b80a4
fix: include TraceState in trace exports (#3569)
* fix: include TraceState in trace exports

Include TraceState in OTEL spans and links.
Print span.traceState in ConsoleSpanExporter.

* Update experimental/CHANGELOG.md

* Update CHANGELOG.md
2023-01-27 10:39:51 -05:00
Mend Renovate dcb09b76d1
chore(deps): update dependency gh-pages to v5 (#3571)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-27 09:21:53 -05:00
Matthew Wear 3bc93a9fa6
feat: exponential histogram - part 1 - mapping functions (#3504)
* feat: add exponential histogram mapping functions

* Apply suggestions from code review

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* chore: fix compile

* refactor: use Number.MAX_VALUE directly

* chore: add docs to mapping and ieee754

* chore: move MIN_SCALE and MAX_SCALE to unexported constants

* chore: remove currently unused test helper

* chore: lint

* refactor: build all scales, extract single getMapping function

* fix: off by one error when pre-building mappings

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-27 08:31:57 -05:00
Gerhard Stöbich 3670071468
fix: avoid grpc types dependency (#3551)
* fix: avoid grpc types dependency

Avoid a dependency to grpc types by moving the into a internal-types.ts file.

* Update CHANGELOG.md

Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-25 08:20:58 -05:00
Gerhard Stöbich b5ef0e4625
chore: fix proto generation (#3567)
Seems protobufjs 7.2.0 requires to include a search path.
2023-01-25 08:04:36 -05:00
Mend Renovate 77f7753392
chore(deps): update dependency mkdirp to v2 (#3554)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-24 14:46:40 -05:00
Santosh Cheler bcfb1b63d5
Match Accept header with Content-Type in the proto exporter (#3562)
* Match Accept header with Content-Type in the proto exporter

* Lint fixes

* Add changelog entry
2023-01-24 14:13:08 -05:00
Purvi Kanal 9589d541ce
feat: browser support for exporter-trace-otlp-proto (#3208)
* add node & browser platform for exporter-trace-otlp-proto

* add browser support for proto base exporter

* add base browser class with xhr support

* add browser class for proto trace exporter

* slight tweaks to make it work

* send data as blob to avoid making sync xhr requests

* fix lint

* remove console.logs and add browser proto example

* cleanup and start adding tests

* Undo formatting changes

* exporter-trace-otlp-proto: fix compile errors

* Misc updates from review comments

* Adding changelog entry

* Reverting format changes not needed

* Moving the send function into the class for browser case.

* Adjust indentation to fix lint errors

* Remove template parameter that's not needed

* Apply review changes

* fix the import path

* Addressing lint errors

* Explicit imports for browser case

* More explicit exports

* Add missing exports

* Address lint issues with export statements

* Adding missing exports

* Adding missing export

* Using import from top level folder

* Trigger Build

* Update experimental/packages/exporter-trace-otlp-proto/test/browser/CollectorTraceExporter.test.ts

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>

* Remove trailing comma

* Remove blank line to fix lint error

* Fixes based on testing opentelemetry-web/fetch-proto

* Add additional missing export

* Skip hex conversion of traceId for the protobuf

* Add esm/esnext builds for the proto packages

that will now be used for the browser case as well.

* Trigger Build

Co-authored-by: Santosh Cheler <scheler@cisco.com>
Co-authored-by: Santosh Cheler <santosh.cheler@gmail.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2023-01-20 14:12:20 +08:00
yehonatanz 652d167531
fix(typo): Fix typo in Resource.default docstring (#3547) 2023-01-18 15:17:15 +01:00
Chengzhong Wu 51273714ef
chore: fix cross project links and missing implicitly exported types (#3533) 2023-01-16 18:00:22 +08:00
Pete Davids a42e4edef4
fix(sdk-metrics): use Date.now() for instrument recording timestamps 2023-01-14 20:36:37 +08:00
Chengzhong Wu c87a304898
fix(sdk-metrics): collect metrics when periodic exporting metric reader flushes (#3517)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-14 19:37:19 +08:00
Daniel Dyla 49c75b8c6d
Fix changelog link (#3536) 2023-01-13 16:15:46 -05:00
Daniel Dyla 07b14384a7
fix(metrics): export MetricsAPI type (#3535) 2023-01-13 11:33:10 -05:00
Daniel Dyla 08f597f3a3
chore: release API 1.4.0 / SDK 1.9.0 / 0.35.0 (#3516)
* chore: release SDK 1.9.0 / 0.35.0

* Update readme

* Move API changelog entries

* Add API to release

* API changelog

* Update additional api max version
2023-01-11 16:06:29 -05:00
Daniel Dyla 969bb62696
fix(tracing): make spans resilient to performance clock drift (#3434)
* fix(tracing): make spans resilient to performance clock drift

* Fix changelog

* Do not export getTimeOrigin

* Apply shift to shim spans

* Lint

* Lint

* Remove unused imports

* Fix drift calculation

* Remove bad import

* Use Date.now for fetch span end

* Fetch changelog

* Test addHrTimes

* lint

* lint

* lint

* Fix flaky test

* lint

* Use perf timer for perf API

* Apply date fix to xhr

* Changelog

* lint

* Revert to previous addHrTimes impl

* Review comments

* Fix flaky test
2023-01-11 15:37:23 -05:00
Daniel Dyla 2dcc898514
Document repo settings (#3519)
* Document repo settings

* Update .github/repository-settings.md

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>

* Update settings

Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2023-01-04 12:42:10 -05:00
Marc Pichler 475e4016d3
docs(sdk-metrics): fix badge and reword introductory sentence (#3484) 2023-01-04 23:41:00 +08:00
Svetlana Brennan 126ae93d1f
fix(sdk-node): fix exporter to be read only OTEL_TRACES_EXPORTER is set to a valid exporter (#3492)
* fix(sdk-node): refactor to use otlp as default exporter when env is empty

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* fix(sdk-node): add changelog

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* (sdk-node): using existing env source

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>
2023-01-03 13:11:27 -05:00
Chengzhong Wu c93ab9e84e
fix(core): fix precision loss in numberToHrtime (#3480) 2023-01-03 23:53:25 +08:00
Chengzhong Wu 3fd6fb8a8f
fix(sdk-metrics): fix duplicated registration of metrics for collectors (#3488) 2023-01-03 23:32:29 +08:00
Chengzhong Wu 93222fc65a
fix(api): declare this parameter type in observable callbacks (#3497)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2023-01-03 18:44:21 +08:00
Raz eecb8009a3
feat(sdk-node): configure no-op sdk with `OTEL_SDK_DISABLED` environment variable (#3485)
Co-authored-by: legendecas <legendecas@gmail.com>
2023-01-02 15:56:08 +08:00
fuaiyi 1c3af6ce28
feat(api-logs): add the SeverityNumber enumeration (#3443)
* feat(api-logs): add the SeverityNumber enumeration

* feat(api-logs): add the SeverityNumber enumeration

* feat(api-logs): add the SeverityNumber enumeration
2022-12-21 11:37:23 -05:00
Chengzhong Wu faa0a33b62
fix(instrumentation-http): close server span when response finishes (#3407) 2022-12-21 00:47:48 +08:00
Gerhard Stöbich 2fb80ebe19
fix(api): use active context as default in NoopTracer (#3476)
* fix(api): use active context as default in NoopTracer

To support the API without SDK use cast to forward a span context it's needed
to fetch active context via ContextManager also in NoopTracer. Otherwise only
direct passing of a context works but not if context.with() is used.

* update PR link

* fixup: correct link

* remove unneeded assert
2022-12-14 11:33:37 -05:00
Saumya 263ee6196f
fix(selenium-tests): updated webpack version for selenium test (#3456)
Signed-off-by: SaumyaBhushan <saumya@knoldus.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2022-12-14 01:32:02 +08:00
Jackson Weber 6410ca1e19
fix(prometheus-serializer): correct string used for NaN (#3477) 2022-12-13 15:45:13 +08:00
Sami Musallam e3a81d2d18
fix(prometheus-sanitization): replace repeated `_` with a single `_` (#3470)
* fix(prometheus-sanitization): fix multiple underscores

* fix(prometheus-sanitization): updated test to check for multiple underscores as well

* fix(prometheus-sanitization): updated CHANGELOG.md

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-12-08 17:38:55 +08:00
Mend Renovate e70cdebad4
fix(deps): update dependency express to v4.17.3 [security] (#3474)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-12-07 11:52:36 -05:00
Gerhard Stöbich e4927f8d9a
chore: improve windows compatibility of update-ts-config (#3475)
* chore: improve windows compatibility update-ts-config

Change update-ts-config script to generate posix path also on windows to avoid
that tsconfig.json files are wrongly modified.

* fixup add comment
2022-12-07 11:46:09 -05:00
Mend Renovate c24227e08d
chore(deps): update dependency sinon to v15 (#3462) 2022-12-07 17:52:17 +08:00
Marc Hassan fb87ee9484
fix(instrumentation): only call `onRequire` for full matches on core modules with sub-paths (#3451)
* fix(instrumentation): only call `onRequire` for full matches on core modules with sub-paths

* chore: add changelog entry

* chore(instrumentation): add `ModuleNameTrieSearchOptions` type

* chore(instrumentation): fix linting errors

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-12-05 16:16:18 -05:00
Ty Bekiares 6ea4b41d8e
feat(instrumentation-grpc): set net.peer.name and net.peer.port on client spans (#3430)
Fixes https://github.com/open-telemetry/opentelemetry-js/issues/3429
2022-12-05 19:24:32 +01:00
Marc Hassan 285f282c62
fix(instrumentation): add back support for absolute paths via `require-in-the-middle` (#3457)
* fix(instrumentation): add back support for absolute paths via `require-in-the-middle`

* chore: add changelog entry

* chore(instrumentation): fix indentation

* chore(instrumentation): add enable/disable tests for `InstrumentationBase`

* chore(instrumentation): fix linting errors
2022-12-05 11:01:45 -05:00
Marc Pichler 91f94a81bc
docs(otlp-*-exporter-base): add internal use note (#3453) 2022-12-04 17:11:51 +01:00
Chengzhong Wu 369b07e1c7
chore: enforce format with prettier (#3444) 2022-12-01 14:58:56 +08:00
Amir Blum b152497e5f
fix(instrumentation-grpc): always set grpc semcov status code attribute with numeric value (#3076) 2022-11-30 13:57:28 +02:00
Sami Musallam db0ecc3768
Add grpc request and response metadata (#3386)
Fixes https://github.com/open-telemetry/opentelemetry-js/issues/3358
2022-11-23 18:43:38 +01:00
Chengzhong Wu 897c1365e4
chore: automatically generate tsconfigs (#3432)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2022-11-23 23:34:41 +08:00
Chengzhong Wu ed98c6feba
chore(instrumentation): pin @opentelemetry/sdk-metrics to v1.8.0 (#3431)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-23 10:34:12 +08:00
Siim Kallas 3290b25d0a
chore(otlp-proto-exporter-base): update protobufjs to 7.1.2 (#3433)
* chore(otlp-proto-exporter-base): update protobufjs to 7.1.2

* chore: update changelog
2022-11-22 11:40:47 -05:00
t2t2 c9a3494dc2
fix(instrumentation-xhr): http.url attribute should be absolute (#3200) 2022-11-22 16:59:52 +08:00
Phillip Carter b9f5561d19
Add getActiveBaggage API (#3385)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Resolves https://github.com/open-telemetry/opentelemetry-js/issues/3354
2022-11-20 16:50:16 +01:00
Osher Vaknin b29deeed50
feat(instrumentation): add new setMeterInstruments method (#3267)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Fixes https://github.com/open-telemetry/opentelemetry-js/issues/3249
2022-11-20 16:28:26 +01:00
Mend Renovate e315f53263
chore(deps): update dependency chromedriver to v107 (#3382) 2022-11-18 17:00:13 +08:00
Amir Blum e133f3f5c3
fix(api): deprecate MetricAttributes and MetricAttributeValue (#3406)
* docs: fix comment in metrics api refering to span

* fix(api): deprecate MetricsAttributes and MetricAttributeValue

* fix: typo in changelog

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-16 14:11:53 -05:00
Chengzhong Wu bd565475a9
fix(api): disable module concatenation in tree-shaking test (#3409)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-16 00:50:00 +08:00
Marc Pichler 125f11e721
fix(sdk-metrics): use default Resource to comply with semconv (#3411)
* fix(sdk-metrics): use default Resource to comply with semantic conventions

* fix(prometheus-exporter): escape default resource attribute values

* fix(changelog): use correct pr number
2022-11-15 10:43:41 -05:00
Mend Renovate 1b7246abb4
chore(deps): update actions/stale action to v6 (#3273) 2022-11-15 13:38:29 +08:00
Mend Renovate c032493d09
chore(deps): update dependency lerna to v6 (#3333)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-11-13 17:06:32 +01:00
Chengzhong Wu b4f04ae01d
feat(instrumentation-http): monitor error events with events.errorMonitor (#3402)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-11-13 16:42:26 +01:00
Gerhard Stöbich 76073eeb20
chore: remove experimental note in sdk-metrics (#3403) 2022-11-13 16:18:49 +01:00
Daniel Dyla d1621d2c8b
Update API readme and doc links (#3401)
* Update readme docs link to reflect new API location

* Update feature status

* Fix API doc links and readme
2022-11-10 17:09:03 -05:00
Marc Pichler 258b677dbc
feat(console-metric-exporter): add temporality configuration (#3387)
* feat(console-metric-exporter): add temporality configuration

* feat(console-metric-exporter): use a temporality selector instead

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-10 15:23:50 -05:00
Weyert de Boer 74e39c7788
docs: add Metrics documentation to project (#3360)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-10 08:53:09 -05:00
Daniel Dyla 7972edf665
chore: release SDK 1.8.0 / Experimental 0.34.0 with metrics GA (#3340) 2022-11-09 14:21:50 -05:00
Daniel Dyla 27c4f76294
chore: release API 1.3.0 (#3399) 2022-11-09 13:32:23 -05:00
Simen Bekkhus baf0feea26
feat(api): Optionally suppress warning about logger being overwritten (#3366)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-11-08 14:51:58 -05:00
Chengzhong Wu c6ff50ee18
docs: document how to implement a propagator (#3351)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-11-08 13:42:36 -05:00
Chengzhong Wu 85c62ef617
docs(api): fix counter negative value wording (#3396) 2022-11-08 16:15:49 +08:00
Marc Pichler d154066354
deps(instrumentation-http): move sdk-metrics to dev dependencies (#3380) 2022-11-04 08:27:04 +01:00
Chengzhong Wu 1536a7cbb2
feat(api): merge api-metrics into api (#3374)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2022-11-03 14:53:54 -04:00
Daniel Dyla bdc603cc76
Update README (#3369) 2022-11-02 08:50:04 -04:00
Abinet18 2cee814ea8
Browser detector module (#3292) 2022-11-01 20:21:27 -04:00
Daniel Dyla a3e40da38a
Revert #3134 - remove anchored clock (#3359) 2022-10-28 13:01:22 -04:00
Chengzhong Wu f31448ed5c
fix(resources): strict OTEL_RESOURCE_ATTRIBUTES decoding (#3341)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-10-28 10:42:42 -04:00
Daniel Dyla e9347e4671
Release metrics API as 1.0 (#3348) 2022-10-27 14:57:16 -04:00
Daniel Dyla d808e2957f
Add semver check to metrics API (#3357) 2022-10-26 15:36:52 -04:00
Marc Pichler 4420402e16
feat(metrics-exporters): configure temporality via env var(#3305)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-10-24 15:10:32 +02:00
Siim Kallas 30a81bdcd7
chore: fix grpc and proto-loader deps (#3337)
* chore: fix grpc and proto-looader deps

* doc: update changelog
2022-10-21 17:34:29 +08:00
Hector Hernandez 292a53df66
feat: add tracing suppresing for Metrics Export (#3332) 2022-10-21 09:56:29 +08:00
Marc Hassan bbc1811b02
feat(instrumentation): implement `require-in-the-middle` singleton (#3161)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2022-10-20 15:51:42 -04:00
Purvi Kanal 0d4c71fc50
feat: enable tree shaking (#3329)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-10-19 21:44:50 +02:00
Daniel Dyla 6ede1ee179
Remove got temporarily (#3347) 2022-10-19 11:03:33 -04:00
Daniel Dyla ec8ff16370
fix: enforce consistent span durations (#3327) 2022-10-17 17:17:30 -04:00
Marc Pichler 3ab8bfcedb
feat(prometheus): serialize resource as target_info gauge (#3300) 2022-10-17 08:16:39 -04:00
Chengzhong Wu 92f235964d
fix(instrumentation): debug log on no modules defined for instrumentation (#3308)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-10-17 10:27:07 +08:00
Anthony Telljohann a7d053ae5a
fix(resources): fix when attribute values contain spaces (#3302)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-10-14 11:10:42 -04:00
Daniel Dyla 07a16b7c90
Test API with old node versions (#3296)
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2022-10-14 09:43:33 -04:00
Daniel Dyla efb0275ffe
ci: run browser tests without circle (#3328)
* ci: run browser tests without circle

* Reduce scope

* Bring back other tests

* Apply to webworker tests

* Changelog

* Use specific node version

* Review comments

* Downgrade node in both places
2022-10-14 15:42:09 +08:00
Marc Pichler aa263e5c27
fix(build): pin checkout actions for web build to 3.0.2 (#3321) 2022-10-12 11:06:11 -04:00
Chengzhong Wu ef6fcdcd1a
feat(sdk-trace): re-export sdk-trace-base in sdk-trace-node and web (#3319) 2022-10-11 09:04:48 -04:00
WhiteSource Renovate 40ee3825a4
chore(deps): update dependency @types/mocha to v10 (#3286) 2022-10-09 16:42:11 +08:00
Chengzhong Wu b934cbc486
docs: merge package api docs (#3255)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-10-07 16:21:18 +08:00
Marc Pichler 1864a9a50c
fix(exporters): do not append trailing '/' when URL contains path (#3274) 2022-10-05 11:26:15 -04:00
Marc Hassan e91cac503c
fix(node-sdk): move `@opentelemetry/semantic-conventions` to `dependencies` (#3283)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-09-30 07:55:09 +02:00
Svetlana Brennan 6b8bb15ab5
feat(sdk-node): configure trace exporter with environment variables (#3143)
* feat(sdk-node): wip add functionality to retrieve list of exporters

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): wip add functionality to configure otlp

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): wip add otlp protocol retrieval

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): wip configure span processor

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): wip create node tracer providers

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add otlp exporter tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): refactor otlp protocol logic

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): refactor configure exporter function

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add zipkin and jaeger exporters and tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add console exporter and tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add console exporter and tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): handle invalid exporters case

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix tests failing due to newly added feature

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add more unit tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add changelog

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add documentation to readme

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add comments to public methods

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add integration tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint in readme

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint in readme

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): refactor to use class for tracer with env exporters

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): refactor sdk class and tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix typo

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix typo

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix metric test

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint and refactor

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* Rename tracerProviderWithEnvExporter.ts to TracerProviderWithEnvExporter.ts

* feat(sdk-node): move adding span processors to different class

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add more tests and reconfigure some tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add missing env value deletion after test

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): fix lint

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): override register method and upate logic and tests

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): add override for addspanprocessor method

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* feat(sdk-node): undo accidental changelog removal

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>

* Undo accidental empty change heading

Signed-off-by: Svetlana Brennan <50715937+svetlanabrennan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-09-29 14:48:11 +08:00
Marc Pichler afe0657723
docs(metrics-exporters): fix wrong exporter const name in example (#3271) 2022-09-24 09:25:20 +02:00
Daniel Dyla c268832689
chore: add api to monorepo (#3261)
* Add API to lerna

* Update todo

* Expect instead of ignore error

* Add webpack test context

* Block scope test variables

* Fix linting

* Fix lining path

* Fix lint

* Fix lint

* Update index-webpack.worker.ts

Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
2022-09-22 17:29:00 +08:00
Daniel Dyla 6111ae0181
chore: remove repo specific files from api dir (#3260) 2022-09-19 15:31:18 -04:00
Chengzhong Wu d8dabf1be3
docs: update exporter guide (#3256)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-09-18 10:38:11 +02:00
Sami Musallam 0074ee2ccd
Validate maxExportBatchSize in BatchSpanProcessorBase (#3232) 2022-09-18 10:19:18 +02:00
Marc Pichler 7870438d1f
chore: ignore @opentelemetry/api in renovate config (#3265)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-16 09:28:41 -04:00
WhiteSource Renovate 6fadc6e9a2
chore(deps): pin dependency protobufjs-cli to 1.0.2 (#3263) 2022-09-16 08:57:05 -04:00
Daniel Dyla ad88c3d9aa
chore: proposal 1.7.0/0.33.0 (#3259) 2022-09-16 07:55:46 -04:00
Marc Pichler 4422d8ce21
deps: remove unused protobufjs and update used ones to 7.1.1 (#3251)
* deps: remove unused protobufjs and update used ones to 7.1.1

* fix(changelog): add chanelog entry.

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-15 11:32:03 +08:00
Marc Pichler ec56837f22
chore: fix markdownlint issues (#3252)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-14 11:21:38 -04:00
Marc Pichler 9c102b765d
deps: update markdownlint-cli to 0.32.2 (#3253) 2022-09-14 08:16:13 -04:00
Marc Pichler fade3c989b
ci(instrumentation-http): improve metrics test stability (#3242)
* fix(instrumentation-http): improve metrics test stability

* fix(changelog): add changelog entry.

* fix(instrumentation-http): clean up test reader.

* fix(changlog): move entry to internal

* fix(instrumentation-http): fix TestMetricReader
2022-09-14 00:25:51 +08:00
Marc Pichler bd0a77f8ba
docs(sdk-metrics): fix typos and add missing parameter docs (#3244)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-13 13:31:21 +02:00
WhiteSource Renovate 032f68f27d
chore(deps): update node.js to v18 (#3204) 2022-09-13 17:02:32 +08:00
Daniel Dyla 0f178d1e2e
Merge api repository into main (#3245)
Co-authored-by: Mayur Kale <mayurkale@google.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Naseem <naseemkullah@gmail.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: shivkanya9146 <62445341+shivkanya9146@users.noreply.github.com>
Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Mark Wolff <mark.wolff@microsoft.com>
Co-authored-by: Bryan Clement <bclement01@gmail.com>
Co-authored-by: dengliming <liming.d.pro@gmail.com>
Co-authored-by: srjames90 <srjames@lightstep.com>
Co-authored-by: Michael Goin <michaelgoin@users.noreply.github.com>
Co-authored-by: Mark <markseufert1@gmail.com>
Co-authored-by: Matthew Wear <matthew.wear@gmail.com>
Co-authored-by: Andrew <DrontXL@yandex.ru>
Co-authored-by: Srikanth Chekuri <srikanth.chekuri92@gmail.com>
Co-authored-by: Paul Draper <paulddraper@gmail.com>
Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
Co-authored-by: Taavo-Taur "t2t2" Tammur <taavot@gmail.com>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Karen Xu <karenyrxu@gmail.com>
Co-authored-by: Adam Dobrawy <ad-m@users.noreply.github.com>
Co-authored-by: Trent Mick <trentm@gmail.com>
Co-authored-by: Severin Neumann <severin.neumann@altmuehlnet.de>
Co-authored-by: James <45812677+JamesJHPark@users.noreply.github.com>
Co-authored-by: Tyghe Vallard <vallardt@gmail.com>
Co-authored-by: Sam <samredmondtech@gmail.com>
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
Co-authored-by: Phillip Carter <pcarter@fastmail.com>
2022-09-12 14:10:48 -04:00
Marc Pichler c1ef97de3e
chore: upgrade linkinator to 4.0.3 (#3241)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-12 13:49:44 -04:00
Tomer Ghelber f9f7fedb77
feat(opentelemetry-api-metrics): Adding generics to `create{metricType}` (#3170)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-12 11:34:56 -04:00
Marc Pichler b73c29dcff
feat(sdk-metrics): align MetricReader with specification and other language implementations (#3225)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-12 10:31:18 -04:00
Marc Pichler be24d698f9
chore(sdk-metrics): remove accidental export of the SDK Meter class (#3243) 2022-09-12 09:34:25 -04:00
Daniel Dyla 5818129631
feat: anchored clock (#3134)
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-09-10 11:39:40 +02:00
Daniel Dyla 32cb123690
Add metrics packages to generated docs (#3239) 2022-09-08 16:06:46 -04:00
Martin Kuba cdbf67d1c2
Logs/events API (#3117)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
2022-09-08 16:05:04 -04:00
Marc Pichler 5005b0be18
docs(node-sdk): update outdated metric documentation. (#3226) 2022-09-07 15:09:43 -04:00
Hector Hernandez 597ea98e58
Add HTTP Server and Client duration Metrics in HTTP Node.js Instrumentation (#3149) 2022-09-06 14:22:22 -04:00
Marc Pichler a8047ba9cd
docs: add experimental disclaimers to all experimental packages. (#3233) 2022-09-06 09:34:20 -04:00
Marc Pichler c926e3d76b
fix: rollback linkinator (#3231) 2022-09-06 11:31:07 +08:00
Marc Pichler d3adc22c47
chore(api-metrics): clean up exports (#3198)
* chore(api-metrics): clean up exports

* fix(changelog): add changelog entry.

* fix(changelog): add changelog entry.

* fix: formatting.

* fix(changelog): move entry to unreleased.

* fix(instrumentation): remove references to NOOP_METER_PROVIDER

* fix(instrumentation): also stub setMeterProvider.

* sort changelog export list

* feat(api-metrics): add createNoopMeter function.

* feat(api-metrics): document createNoopMeter.

* fix(whitespace): reformat NoopMeter.ts

* chore: add test for createNoopMeter()

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-09-05 16:05:43 +08:00
Osher Vaknin 4e123b5372
feat(node-sdk): added resourceDetectors option to NodeSDK #3210 (#3212)
* feat(node-sdk): added resourceDetectors option to NodeSDK #3210

* feat(node-sdk): fixed markdown lint #3210

* feat(node-sdk): fixed types lint #3210

* feat(node-sdk): added resourceDetectors option to NodeSDK #3210

* feat(node-sdk): added resourceDetectors option to NodeSDK #3210

* feat(node-sdk): updated proto subproject commit NodeSDK #3210

* feat(node-sdk): returned protobuf repos to v0.18.0 #3210

* Update experimental/packages/opentelemetry-sdk-node/README.md

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>

* feat(node-sdk): added breaking changelog #3210

* feat(node-sdk): added breaking changelog #3210

* Update experimental/CHANGELOG.md

Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-09-02 10:46:34 +08:00
avzis a669f9c5e2
chore(deps): update prometheus example dependencies to 0.32 (#3216)
* chore(deps): update prometheus example dependencies to 0.32

* chore(deps): update CHANGELOG
2022-09-01 16:56:43 +08:00
Chengzhong Wu dd22372a09
feat(sdk-metrics-base): per metric-reader aggregation (#3153) 2022-09-01 13:57:05 +08:00
Marc Pichler bd9159a353
chore: cleanup eslint (#3209) 2022-08-29 16:45:25 -04:00
Marc Pichler d4ab03fc56
chore(sdk-metrics): clean up exports (#3197)
* chore(sdk-metrics): clean up exports

* fix(changelog): add entry.

* fix(changelog): move entry to unreleased.

* fix: add TimeoutError back.

* fix: add CollectionResult back in and update changelog.
2022-08-29 15:31:40 +08:00
Daniel Dyla a5abee6911
chore: proposal 1.6.0/experimental 0.32.0 (#3192)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-08-24 13:19:01 -04:00
WhiteSource Renovate 506f40b421
chore(deps): update dependency superagent to v8 (#3180) 2022-08-24 11:15:52 +08:00
WhiteSource Renovate c73d782588
chore(deps): update lerna monorepo (major) (#3190)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-23 13:32:45 -04:00
WhiteSource Renovate b8bcc1abbe
chore(deps): update dependency eslint to v8 (#3187) 2022-08-23 10:55:44 +08:00
Chengzhong Wu fbbc2773c5
Add svetlanabrennan as an approver (#3182)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-22 13:16:32 -04:00
WhiteSource Renovate cc40f1e18a
chore(deps): pin dependencies (#3179) 2022-08-22 13:15:20 -04:00
Siim Kallas 9b5149cb0c
perf: improve hexToBase64 (#3178)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-22 11:15:41 -04:00
Daniel Dyla 406a059198
deps: update API max version (#3177) 2022-08-22 08:35:32 -04:00
Chengzhong Wu 34c5bdba67
docs(prometheus-exporter): fix prometheus exporter examples in README (#3110)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-17 11:40:24 +08:00
Weyert de Boer 43f4e5a332
feat: add the ability to set the views via the SDK constructor (#3124)
* feat: add the ability to set the views via the SDK constructor

* docs: update CHANGELOG.md

* test: added test for checking if views configured when passed to the SDK

* test: update test to check view got applied by renaming an counter metric's name

* style: run `lint:fix` command on package

* style: remove unused imports

* style: fix identation linting issue in `sdk.test.ts`

* docs: add reference to views-parameter of the NodeSDK

* fix: throw an error when NodeSDK is used incorrectly

* fix: improve the way handling views without metric reader

* chore: update code

* test: update the test cases

* fix: update reader, if needed

Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
2022-08-17 11:19:02 +08:00
Hector Hernandez 6807deff5a
Rename @opentelemetry/sdk-metrics-base to @opentelemetry/sdk-metrics (#3162)
* Rename @opentelemetry/sdk-metrics-base to @opentelemetry/sdk-metrics

* Update all remaining references

* Addressing comments

* Add pr number in changelog

* Changing path of metrics SDK project
2022-08-16 10:00:49 +08:00
WhiteSource Renovate 3cca2cec8f
chore(deps): update dependency linkinator to v4 (#3163) 2022-08-14 10:04:26 +08:00
Chengzhong Wu 2e23d7480c
chore: add windows unit test action (#3136)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-12 10:31:48 +08:00
Daniel Dyla 038df3fa77
Update non-web dev deps (#3157) 2022-08-11 12:09:57 -04:00
Marc Pichler f882b71c68
chore: update `trace-web` example and rename it to `opentelemetry-web` (#3145)
* chore: update trace-web metrics sample.

* update versions to 0.31.0.

* fix(changelog): add changelog entry.

* fix(changelog): move changlog entry.

* fix(opentelemetry-web): make stopMetrics() non-async.
2022-08-10 00:01:15 +08:00
WhiteSource Renovate dc2d093809
chore(deps): update dependency gh-pages to v4 (#2985)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-09 08:59:04 -04:00
Marc Pichler 7b3eab6e47
chore: update `https` example (#3152) 2022-08-09 08:40:02 -04:00
Weyert de Boer d995b801b9
feat: add ConsoleMetricExporter (#3120)
* feat: add ConsoleMetricExporter

Allow to export metrics to the console

refs #3036

* docs: update CHANGELOG.md

* style: resolve linting issues

* fix: improve logging for metrics console exporter

* fix: improve code for metrics console exporter

* fix: ensure correct ConsoleMetricExporter gets exported in package

* fix: remove unused import statement

* fix: ensure FAILED is returned when export() is called while exporting is shutting down

* test: improve the ConsoleMetricExporter tests

* test: remove unnecessary `exporter.shutdown()`

Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
2022-08-08 10:24:18 +08:00
Daniel Dyla 0c13343150
chore: fix docs deployment (#3044)
* Increase max old space size

* Reduce max free space to 4096

* No need to expand memory on docs test

* Increase headroom

Testing shows that the docs generation uses about 3.9GB so a bit of
headroom seems like a good idea
2022-08-06 23:33:50 +08:00
WhiteSource Renovate ddd0c6b0a7
chore(deps): update github/codeql-action action to v2 (#2938)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-08-05 11:03:47 -04:00
WhiteSource Renovate c6c01b127f
chore(deps): update dependency chromedriver to v104 (#3144) 2022-08-05 08:53:46 -04:00
Daniel Dyla dcc9f860be
Prevent double wrapping event emitter listeners (#3133) 2022-08-03 17:28:59 -04:00
Chengzhong Wu dc67f4e11b
fix(otlp-proto-exporter-base): spawn pbjs without node (#3126)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-08-03 12:24:34 -04:00
Will Li b1c00629c9
fix(instrumentation-http): add http.host attribute before sending the request (#3054)
* add function to extract hostname and port from parsed option

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* add unit test

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* remove code for setting http.host when received the response

Signed-off-by: Cuichen Li <cuichli@cisco.com>

* fix lint issue

* add changelog

* only use manually formatted host when options.host is not defined

* add event listener on timeout so span is closed properly

* add test

* use header as host source instead

* try remove span number check

* update based on comment

* Update experimental/CHANGELOG.md

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-07-30 18:08:53 +02:00
andrewzenkov e76cb8b6d8
GRPC instrumentation. Added new attributes according to the OpenTelemetry rpc convention (#3127)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-07-30 16:55:29 +02:00
Jaryk fc4dcba9b6
refactor(fetch): revert to original code in endSpanOnSuccess (#3037) 2022-07-30 16:32:53 +02:00
Weyert de Boer 492a3e8825
feat: export unit block when unit is set in metric descriptor (#3041)
Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-29 13:45:51 -04:00
Chengzhong Wu df58facdde
feat(sdk-trace-base): move Sampler declaration into sdk-trace-base (#3088)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-29 11:08:36 +08:00
Svetlana Brennan 3db10568be
fix(sdk-trace-base): fix spanLimits attribute length/count to consider env values (#3068)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
2022-07-28 13:38:09 -04:00
Daniel Dyla 776656b6e0
chore: release proposal 1.5.0 / 0.31.0 (#3112) 2022-07-26 16:22:46 -04:00
Trivikram Kamat 37ecb596ab
docs: add homepage links (#3114)
* docs: add homepage links

* fix: remove additional commas added during copy-paste

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

* chore: add instruction to update homepage location

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-26 10:34:52 -04:00
Daniel Dyla 79cb83d1b0
chore: update changelog to reflect #3098 fixed #2791 (#3111) 2022-07-26 10:30:28 -04:00
Weyert de Boer 5ae0a37ddb
feat: add InMemoryMetricExporter (#3039)
* feat: add InMemoryMetricExporter

Introduces the `InMemoryMetricExporter`-class which collects metrics and stores it in memory

* style: improve comments

* style: improve comments

* test: created test for the `InMemoryMetricExporter`-class

* fix: remove the `clear`-method from `InMemoryMetricExporter`-class

* fix: add missing `ResourceMetrics` import

* style: ran `lint:fix` command on the code base

* docs: add CHANGELOG.md entry for the new `InMemoryMetricExporter`-class

* test: drop the `describe.only`

* test: improve test coverage

* Split reset and forceFlush

* fix: remove meterprovider typo

* Remove calls to missing setup method

* Use api meter in test

* Browser support

* style: lint

Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-26 08:38:28 -04:00
Marc Pichler 1d0eaefe09
feat(histogram): align collection of optional `Histogram` properties with spec (#3102)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-25 09:39:20 -04:00
Siim Kallas d5cf120d72
fix: don't let PeriodicExportingMetricReader block process exit (#3106) 2022-07-23 14:04:34 +02:00
Chengzhong Wu 1a0e0c44d2
feat(metrics-api): use common attributes definitions (#3038)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-21 00:46:40 +08:00
Chengzhong Wu 18dce78c47
docs: merge outdated development-guide.md (#3081)
Co-authored-by: Marc Pichler <marcpi@edu.aau.at>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-20 11:12:27 -04:00
Rauno Viskus 69cf899090
feat: allow extending `BasicTracerProvider` with custom registered components (#3023)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-07-20 11:11:51 -04:00
Chengzhong Wu 1e8b896d68
feat(otlp-proto): pre-compile proto files (#3098)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-07-20 10:06:46 +08:00
Marc Pichler 9ac9976b38
feat(sdk-metrics-base): distinguish between Sum and Gauge in MetricData (#3079)
* feature(sdk-metrics-base): distinguish between Sum and Gauge in MetricData

* feat(sdk-metrics-base): fix test.

* fix(changelog): add changelog entry.

* feat(prometheus-serializer): add test for gauge serialization.

* feat(sdk-metrics-base): add assertions for isMonotonic in Instrument tests.

* feat(otlp-transformer): add test-cases for non-monotonic sums.

* feat(prometheus-exporter): add test-cases for gauges.

* fix(sdk-metrics-base): remove DataPointType.SINGULAR

* fix(changelog): add more details about breaking changes.
2022-07-20 01:25:14 +08:00
Daniel Dyla 4ee8fe38c4
chore: use latest npm after setup node (#3101) 2022-07-18 23:24:16 +08:00
Marc Pichler bec6c3c085
feature(views): move views registration to MeterProvider constructor (#3066) 2022-07-18 09:55:15 -04:00
Marc Pichler db32860bb4
fix(histogram): fix maximum when only values < -1 are provided (#3086) 2022-07-15 11:06:51 +02:00
Nfer Zhuang 747c404fb1
typo on example link (#3083) 2022-07-11 08:57:33 -04:00
Chengzhong Wu b4707e4c2f
docs(sdk-metrics): update document on public interfaces (#3075)
Co-authored-by: Valentin Marchaud <thisismac47@gmail.com>
2022-07-09 00:59:56 +08:00
Daniel Dyla e39ab883b1
release proposal 1.4.0/0.30.0 (#3065) 2022-07-06 15:55:05 -04:00
Marc Pichler 474ec864ec
docs(exporters): replace 'collector' with 'OTLP compatible receivers' (#3077) 2022-07-06 08:53:08 -04:00
Marc Pichler 6dd6af33c3
docs(grpc-exporters): remove 'web' as supported from README.md (#3070)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-06-30 14:04:46 -04:00
Chengzhong Wu 6eca6d4e4c
feat(sdk-metrics-base): detect resets on async metrics (#2990) 2022-06-29 01:42:37 +08:00
Daniel Dyla 43783038cc
New bug form and triage workflow (#3058) 2022-06-26 10:09:01 -04:00
Matt Olson 0727ed74e8
Fix gzip compression for OTLP HTTP exporter (#3046)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-06-24 10:59:43 -04:00
Marc Pichler d2de661de0
feat(sdk-metrics-base): implement min/max recording for Histograms (#3032)
* feat(sdk-metrics-base): prepare min/max collection.

* chore: updating submodule for otlp-grpc-exporter-base

* chore: updating submodule for otlp-proto-exporter-base

* feat(sdk-trace-base): implement min/max recording, add tests.

* feat(docs): update metrics exporter compatibility.

* fix(changelog): add changelog entry.

* fix(changelog): add more detail to changelog.

* fix(changelog): reword, appease linter.

* refactor(sdk-metrics-base): inline hasMinMax(), reformat.

* fix(otlp-transformer): simplify distinction with for data with min/max and without.

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-06-24 08:52:42 -04:00
Daniel Dyla fa295a3298
Add node 18 to tests and remove EoL node versions (#3048) 2022-06-23 15:11:43 -04:00
Jaryk b8915092bc
fix(instrumentation): use all provided filepatches (#2963)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-06-22 11:37:47 -04:00
Daniel Dyla cb642d7c28
chore: do not mark bugs stale (#3053) 2022-06-21 14:53:19 -04:00
Naseem Ullah fcb9565067
feat(node-sdk): add serviceName config option (#2867)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-06-20 22:48:59 +08:00
Mat Schaffer 3cc40d78b4
feat(opentelemetry-exporter-prometheus): export PrometheusSerializer (#3034)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-06-17 11:24:30 -04:00
Inokentii Mykhailov 5f9ef511dd
feat(@opentelemetry-instrumentation-fetch): optionally ignore network events (#3028)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-06-15 13:51:24 +02:00
Luismi Ramírez c8c4ec6041
feat: record exceptions in http instrumentation (#3008) 2022-06-13 11:43:36 +08:00
Chengzhong Wu 922e963eca
fix(sdk-trace-base): fix crash on environments without global document (#3000) 2022-06-08 19:57:46 +02:00
Marc Pichler 0ed21bc99c
fix(grpc-exporter): use non-normalized URL to determine channel security (#3019)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-06-08 10:38:15 -04:00
Gerhard Stöbich 1f742e489c
fix: remove aws and gcp detector from SDK (#3024)
AWS and GCP detectors were moved to contrib.
NodeSDK should not depend on contrib resources.
2022-06-08 14:35:13 +02:00
Chengzhong Wu 48e960a4e6
fix(otlp-transformer): remove type dependency on Long (#3022)
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2022-06-08 01:16:17 +08:00
WhiteSource Renovate 9c9789af0b
chore(deps): update dependency protobufjs to v6.11.3 [security] (#3017) 2022-06-07 17:16:04 +08:00
Daniel Dyla 51afd54bd6
chore: release proposal 1.3.1/0.29.2 (#3018) 2022-06-06 15:29:41 -04:00
Daniel Dyla 094f016ac6
chore: hotfix release 0.29.1 (#3013) 2022-06-01 13:40:49 -04:00
Chengzhong Wu bf0783a7bf
docs: fix experimental example links (#3007) 2022-06-01 11:55:37 -04:00
Daniel Dyla d10b25471f
fix(otlp-transformer): add missing prepublishOnly script (#2998)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-06-01 11:11:49 -04:00
Chengzhong Wu 7649cf1736
fix(resources): fix browser compatibility for host and os detectors (#3004)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-06-01 10:48:42 -04:00
Marc Pichler fcef5e21af
fix(sdk-metrics-base): only record non-negative histogram values. (#3002) 2022-05-30 20:41:06 +02:00
Jaryk fd95d42c19
test(fetch): make prepareData async to enforce fakeTime order (#2969)
* test(fetch): make prepareData async to enforce fakeTime order

* test: remove unnecessary intermediate variable

* test(fetch): stub endSpan to await its call

* Update experimental/packages/opentelemetry-instrumentation-fetch/test/fetch.test.ts

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2022-05-30 22:23:27 +08:00
Gerhard Stöbich e44f6d1a10
fix: remove attributes from OTLPExporterConfigBase (#2991)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-05-28 11:17:34 +02:00
Santiago Gimeno edf6157900
fix(instrumentation): only patch core modules if enabled (#2993)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-05-28 10:40:17 +02:00
Daniel Dyla eda0b092db
Release proposal 1.3.0/0.29.0 (#2995) 2022-05-27 15:24:18 -04:00
Andy Fleming 7196b7f9e7
fix(metrics): updates unit option behavior to be spec-compliant (#2983)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-27 11:26:38 -04:00
Marc Pichler 7149f6cdb3
fix(otlp-transformer): include esm and esnext in package files and update README (#2992)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-27 10:20:11 -04:00
Chengzhong Wu bfd04b0b40
chore(deps): upgrade actions/checkout to v3 (#2979)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-25 11:56:17 -04:00
Chengzhong Wu ba3e3207ed
feat(metrics): multi-instrument async callback support (#2966)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-25 11:13:05 +08:00
Chengzhong Wu 610808d3b6
fix(sdk-web): parse url with relative url string (#2972)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-05-17 22:08:13 +08:00
Svetlana Brennan 69cced26a2
fix(otlp-http-exporter): update endpoint to match spec (#2895)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
2022-05-17 09:18:38 +02:00
Svetlana Brennan a9c59da516
feat(trace-otlp-grpc): configure security with env vars (#2827)
* feat(trace-otlp-grpc): add insecure configs

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add unit tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip add certificate and tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix security config and unit tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add env and certificate tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip certificate tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix lint error

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip add additional security setting checks

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): update default url to http scheme

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip add tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip refactor function around insecure setting

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip update returned security setting for some use cases

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): update certificate and add tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip certificate tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add diag tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): update default url

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add changelog item

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add grpc scheme check and update test

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): add grpc scheme test

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix metrics default url

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): update readme

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix lint

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix changelog and get security from env func

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): wip troubleshoot

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix readme

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): refactor code and fix lint

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): remove grpc scheme and grpc scheme tests

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): fix credentials for failing test afer main merge

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* feat(trace-otlp-grpc): move changelog to unreleased section

Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

* Use exact match for protocol check to avoid leaking cases like httpx

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-17 14:24:31 +08:00
WhiteSource Renovate 22085fc711
chore(deps): update dependency chromedriver to v101 (#2965) 2022-05-13 17:27:31 +08:00
Chengzhong Wu aabc5f6b89
feat(sdk-metrics-base): async instruments callback timeout (#2742)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-13 01:19:38 +08:00
Jaryk 65fbb2f65b
chore(eslint): remove airbnb package (#2955)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-12 23:52:16 +08:00
Chengzhong Wu 269a495945
fix(sdk-metrics-base): misbehaving aggregation temporality selector tolerance (#2958)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-12 10:44:57 +08:00
Svetlana Brennan 479321cdcc
feat(otlp-exporter): add timeout env var (#2738)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-11 16:29:58 -04:00
Daniel Gomez Blanco ac578e9a8d
fix(opentelemetry-instrumentation-http): handle null ports in options (#2948)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-05-11 15:54:22 -04:00
Marc Pichler 97bc6321c0
refactor(metrics-sdk): rename InstrumentationLibrary -> InstrumentationScope (#2959)
* feat(opentelemetry-core): introduce InstrumentationScope.

* refactor(metrics): replace usage of InstrumentationScope with InstrumentationLibrary.

* fix(changelog): update changelog.

* fix(changelog): update (stable) changelog to better reflect what was done.
2022-05-11 22:43:16 +08:00
Daniel Dyla 4c995416e2
Add pichlermarc to approvers (#2960) 2022-05-11 08:17:42 -04:00
Siim Kallas 1ee1b287ed
feat: metric aggregation temporality controls (#2902)
* feat: aggregation temporality controls

* chore: update CHANGELOG

* refactor: move named otlp temporality selectors to OTLPMetricExporterBase

* fix: revert accidental protos change

* refactor: rename preferredAggregationTemporality to temporalityPreference

* doc: better changelog wording

* fix: remove unnecessary files
2022-05-10 19:01:30 +08:00
Chengzhong Wu 858f6ce5f8
docs: retrospectively add prometheus counter suffix change (#2950)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-05-06 22:57:29 +08:00
legendecas 772e6595b3
feat(sdk-metrics-base): hoist async instrument callback invocations (#2822) 2022-05-06 21:13:29 +08:00
Daniel Dyla d98548b424
exporter base: include esm and esnext in package files (#2952) 2022-05-05 11:32:11 +08:00
Marc Pichler 1343d16aa2
feat(exporters): update proto version and use otlp-transformer (#2929) 2022-05-04 17:03:04 -04:00
Gerhard Stöbich 65aeff0dd3
chore: remove unused InstrumentationConfig#path (#2944)
* chore: remove unused InstrumentationConfig#path

* add changelog
2022-05-04 11:17:54 -04:00
Rauno Viskus ddb0775234
feat: implement OSDetector (#2927)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-30 13:53:35 +02:00
Rauno Viskus df77c624e7
feat: implement HostDetector (#2921)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-30 12:01:37 +02:00
Amir Blum dc44b8611b
fix(resources): extend ResourceAttributes interface to comply with spec (#2924)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-30 11:43:50 +02:00
legendecas 6436d858b3
chore: update prometheus examples (#2939) 2022-04-30 09:48:03 +02:00
Ran Nozik 60a17ee8e3
feat: warn when hooked module is already loaded (#2926) 2022-04-27 11:45:10 -04:00
Amir Blum ce7e98fd98
chore: indent the code with eslint (#2923)
* chore: indent the code with eslint

* chore: update changelog

* chore: add lint switch case indent

Co-authored-by: legendecas <legendecas@gmail.com>
2022-04-26 13:52:35 +08:00
Trent Mick 6710cddaa4
feat(ConsoleSpanExporter): export span links (#2917)
* feat(ConsoleSpanExporter): export span links

* test: update test case for change to console.dir

* chore: changelog entry
2022-04-26 12:00:16 +08:00
Gerhard Stöbich a5135e20de
chore(deps): update dependency ts-mocha to v9 (#2920)
* chore(deps): update dependency ts-mocha to v9

* chore: remove test scripts if there are no tests

* chore: remvoe also coverage script

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: legendecas <legendecas@gmail.com>
2022-04-25 21:18:08 +02:00
Daniel Dyla 28a177ffe3
Include metrics in release (#2928) 2022-04-25 09:06:04 -04:00
shmilyoo 4584c36026
fix(propagator-jaeger):extract 1 digit traceFlag(0) return 1 (#2906)
* fix(propagator-jaeger):extract 1 digit traceFlag(0) return 1

* update CHANGELOG

* fix quota

* Parse jaeger flags with radix 16

Co-authored-by: legendecas <legendecas@gmail.com>

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: legendecas <legendecas@gmail.com>
2022-04-24 12:55:06 +03:00
Daniel Dyla a0a670a03f
Release proposal 1.2.0 / 0.28 (#2914) 2022-04-22 10:32:28 -04:00
Marc Pichler e5031bdf65
refactor(exporters): introduce packages for shared exporter classes (#2893)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-04-21 08:49:31 -04:00
Gerhard Stöbich 0f3e4dea3c
chore: cleanup API dependencies (#2904) 2022-04-20 20:52:52 +02:00
Daniel Dyla 75cbf5d491
Fix code coverage paths (#2913) 2022-04-20 13:24:14 -04:00
Daniel Dyla 96465c535a
chore: add coverage scripts to experimental (#2908)
* chore: add coverage scripts to experimental

* Remove codecov from browser only packages

Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-20 17:45:27 +08:00
Nicholas Volker cfda625e83
Update example in ContextZone README.md (#2909) 2022-04-19 13:40:34 -04:00
WhiteSource Renovate f92466980c
chore(deps): update dependency chromedriver to v100 (#2877) 2022-04-19 10:29:50 +08:00
legendecas 2ba6dd5681
feat(sdk-metrics-base): meter identity (#2901) 2022-04-19 10:10:42 +08:00
Daniel Dyla ed2f033815
Merge back into a single lerna monorepo (#2892)
* chore: use a single lerna monorepo

* chore: release API dependencies

* chore: fix selenium exporter

* chore: support old API versions

* chore: update changelog

* chore: remove peer api check

* chore: changelog

* chore: fix cache keys and paths

* chore: fix lint cache

* ci: install when cache misses

* chore: apply cache fix to webworker and web

* chore: apply cache fix to lint

* chore: revert peer api check removal

* chore: match peer and dev dependency versions for API

* chore: send full string to lerna exec

* chore: use npm script for peer api check

* chore: use MetricAttributes in metrics

* chore: use MetricAttributes when appropriate

Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-18 11:12:16 +08:00
legendecas 7086d5aa71
feat(sdk-metrics-base): shutdown and forceflush on MeterProvider (#2890)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-15 20:51:44 +02:00
Daniel Dyla 322dabe86f
chore: remove husky hooks (#2898)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-04-15 20:36:24 +02:00
legendecas 83355af499
fix: sanitize attributes inputs (#2881)
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2022-04-13 15:41:11 +02:00
legendecas 14bd6f93ed
refactor(sdk-metrics-base): meter shared states (#2821) 2022-04-12 01:32:41 +08:00
Marc Pichler 0213d829dc
feat(experimental-packages): Update packages to latest SDK Version. (#2871)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-04-07 16:51:11 -04:00
legendecas eac583e9d8
docs: simplify changelog entry format (#2889)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-04-07 21:27:52 +02:00
Svetlana Brennan 9890767c98
fix(otlp-http-exporter): remove content length header (#2879) 2022-04-06 14:28:22 -04:00
Daniel Dyla 5d9ed3faa5
chore: require a changelog entry to merge PR (#2847) 2022-04-01 09:36:24 -04:00
legendecas b6cb40ffd0
fix(sdk-metrics-base): coerce histogram boundaries to be implicit Infinity (#2859)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-31 17:49:53 +08:00
Einar Norðfjörð 7870e9529f
HTTP 400 status code should not set span status to error on servers (#2789)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-03-28 13:13:25 -04:00
legendecas b749b0daa7
feat(prometheus): update prometheus exporter with wip metrics sdk (#2824)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-28 22:52:46 +08:00
Svetlana Brennan da22673d10
docs(sdk): update earliest support node version (#2860)
Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>
2022-03-27 23:53:46 +08:00
WhiteSource Renovate 1ff9688cfb
chore(deps): update actions/cache action to v3 (#2861) 2022-03-27 23:46:31 +08:00
Daniel Dyla 16eaeb6f0e
chore: move trace exporters back to experimental (#2835)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Gerhard Stöbich <18708370+Flarna@users.noreply.github.com>
2022-03-25 15:10:21 -04:00
Daniel Dyla 549bd5b9f8
feat(proto): add @opentelemetry/otlp-transformer package with hand-rolled transformation (#2746)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-03-23 13:51:15 -04:00
Daniel Dyla b0f8a2d36e
chore: release proposal v1.1.1 (#2853) 2022-03-22 15:01:42 -04:00
legendecas 1f0f6d9bf4
chore: add prepublishOnly to ensure a full build (#2844)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-03-23 01:08:38 +08:00
legendecas 8182dab513
chore: run additional compilation variants (#2823)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-22 19:28:50 +08:00
Gerhard Stöbich 2cb620d9c9
fix: correct changelog and compat matrix for 1.1 release (#2849)
OTLP exporters have been moved back to experimental therefore the corresponding breaking change
will be in 0.28.0.

Corrected compat matrix as SDK 1.0 uses API 1.0 and SDK 1.1 use API 1.1.
2022-03-22 14:10:58 +08:00
Svetlana Brennan 68b93c5f50
feat(otlp-grpc-exporter): add compression configuration to exporter (#2813)
Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-22 14:00:51 +08:00
legendecas 3fd1b1ea91
feat(sdk-metrics-base): update exporting names (#2829)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-21 13:50:14 +01:00
Marc Pichler 70dc60b479
feat(views): Update addView() to disallow named views that select more than one instrument. (#2820) 2022-03-20 11:55:16 +01:00
WhiteSource Renovate e71a5ee6e0
chore(deps): update actions/stale action to v5 (#2842) 2022-03-19 14:36:59 +08:00
Daniel Dyla f384303ac4
chore: release proposal 1.1.0 (#2838) 2022-03-18 04:02:45 -04:00
WhiteSource Renovate 7268daa3db
chore(deps): update actions/setup-node action to v3 (#2841) 2022-03-18 13:43:36 +08:00
Doron Kopit acb03454bd
fix(opentelemtry-core): fix header extraction (#2832)
Co-authored-by: legendecas <legendecas@gmail.com>
2022-03-17 10:17:58 -04:00
Daniel Dyla 038bbdb67a
chore: mark trace exporters private to prevent publish (#2836) 2022-03-16 11:28:45 -04:00
Damien Mathieu 4ca2d89b84
Cleanup removed documentation for missing benchmarks (#2830) 2022-03-14 05:16:40 -04:00
Siim Kallas c6dab2a6e7
refactor: change metrics export data model to match OTLP protos (#2809)
* refactor: match metrics export model with proto

* refactor: get rid of MetricsData

* fix: don't filter empty instrumentation library metrics
2022-03-06 17:16:16 +08:00
legendecas 82192b54e6
docs: document removal of shutdown flag in OTLPExporterBase (#2807)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-05 10:42:51 +01:00
WhiteSource Renovate 043834db0c
chore(deps): update dependency geckodriver to v3 (#2781) 2022-03-05 10:25:41 +01:00
WhiteSource Renovate a0c1236df4
chore(deps): update dependency nightwatch to v2 (#2795) 2022-03-05 10:16:05 +01:00
WhiteSource Renovate 13a0e7e46a
chore(deps): update dependency karma to v6.3.16 [security] (#2811)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-05 09:55:49 +01:00
Marc Pichler 5b83c1828d
feat(views): handle view conflicts. (#2734) 2022-03-05 00:06:31 +08:00
Will Li a901732aca
feat(opentelemetry-resources): add runtime version information (#2727) 2022-03-04 23:55:23 +08:00
Gerhard Stöbich ef03d02a8e
docs: simplify contrib part in readme (#2814) 2022-03-03 12:46:47 -05:00
Svetlana Brennan df0cee9b7f
feat(trace-otlp-http-exporter): add compression env vars (#2796)
Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-02 11:46:12 +08:00
legendecas 9579106a9d
test(sdk-trace-base): pin core.hrtime dependencies on timeOrigin (#2768)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-03-01 11:42:44 +01:00
Daniel Dyla def9ba3ea5
fix(deps): use 1.x trace otlp http exporter (#2788)
Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-02-24 13:56:08 -05:00
legendecas b8df001379
chore: target to es2017 in the no-polyfill target (#2765)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-02-24 16:32:46 +08:00
naseemkullah 144e11ab70
docs(prom-example): remove deprecated startServer option (#2802)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-02-22 14:51:54 -05:00
Srikanth Chekuri 630a26182a
feat(sdk-metrics-base): update metric exporter interfaces (#2707)
Co-authored-by: legendecas <legendecas@gmail.com>
2022-02-22 14:46:56 +01:00
WhiteSource Renovate b756b7c36d
chore(deps): update dependency linkinator to v3 (#2794) 2022-02-19 00:30:11 +08:00
Gerhard Stöbich eb19f3dc5c
fix: pass same context to Sampler and SpanProcessor in root span case (#2790) 2022-02-17 11:30:12 -05:00
WhiteSource Renovate 2da67548ce
chore(deps): update dependency chromedriver to v98 (#2780) 2022-02-16 02:07:49 +08:00
legendecas fd62fa4712
feat(sdk-metrics-base): add ValueType support for sync instruments (#2776) 2022-02-14 10:47:36 +08:00
WhiteSource Renovate e4aa9eb257
chore(deps): update dependency karma to v6.3.14 [security] (#2783) 2022-02-11 18:37:26 +01:00
legendecas ba177fab33
test(sdk-metrics-base): test metric instrument interfaces (#2743)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-02-10 10:14:23 +08:00
Gerhard Stöbich 4fa3270270
fix: sync webpack version used (#2758)
Use the same webpack version used to avoid npm install to fail because of peer dependencies
can't be resolved.

Co-authored-by: legendecas <legendecas@gmail.com>
2022-02-09 08:36:27 +01:00
Chris Karcher 1dd8a89f8a
feat(baggage): include baggage metadata when propagating baggage entries (#2766)
Co-authored-by: legendecas <legendecas@gmail.com>
2022-02-09 12:06:50 +08:00
Will Li 4f8849fc77
docs: specify minimum version of npm to run command in subproject (#2728)
Signed-off-by: Cuichen Li <cuichli@cisco.com>

Co-authored-by: legendecas <legendecas@gmail.com>
2022-02-09 11:24:01 +08:00
Svetlana Brennan ed043be4cf
docs(otlp-grpc-exporter): update default url (#2726)
Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>

Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: legendecas <legendecas@gmail.com>
2022-02-08 11:02:12 +08:00
Amir Blum 31380acd08
fix(exporter-jaeger): add env variable for agent port (#2754) 2022-02-08 10:53:29 +08:00
Gerhard Stöbich 0dc4c3d8eb
fix: add parentContext to onStart (#2757)
Co-authored-by: legendecas <legendecas@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-02-06 11:45:37 +01:00
WhiteSource Renovate 94a0747fa0
chore(deps): update dependency dotenv to v16 (#2762) 2022-02-06 11:28:31 +01:00
WhiteSource Renovate 958c064f92
chore(deps): update dependency chromedriver to v97 (#2761) 2022-02-06 17:08:52 +08:00
WhiteSource Renovate bdb61f7e56
chore(deps): pin dependency linkinator to v2.16.2 (#2744) 2022-02-06 02:25:28 +08:00
Gerhard Stöbich e9e4567647
fix: use api 1.1 in SDKs (#2759)
Use API 1.1 in SDKs to avoid that SDKs register a TracerProvider,... using an older API
then other OTel components.
This avoids the version check in API rejecting the use of API 1.1 but a peer may still
use 1.0.x.
2022-02-06 01:59:35 +08:00
Daniel Dyla ee2342bdb0
feat: add support for API 1.1.x (#2737) 2022-01-31 13:08:31 -05:00
Spencer Wilson ce5f7f7ec3
docs(context): Fix links, edit prose (#2619)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-31 14:31:16 +01:00
Amir Blum a824578c98
fix(exporter-jaeger): transform all links to jaeger reference (#2731)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-31 14:16:36 +01:00
legendecas 3231cdcfd8
test(integration-w3c): fix inconsistent api versions loaded (#2752) 2022-01-31 13:54:52 +01:00
legendecas 754d96d36e
fix(resources): align exported names in different environments (#2739)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-29 09:54:01 +01:00
Marc Pichler e1c32b2daa
feat(views): add FilteringAttributesProcessor (#2733) 2022-01-26 14:21:15 -05:00
legendecas 8daaddc6a4
feat(sdk-metrics-base): document and export basic APIs (#2725) 2022-01-26 14:09:45 +08:00
legendecas 63cff1cbc5
chore: update actions/checkout to v2 (#2715)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-01-26 13:52:21 +08:00
legendecas 04f9edd12f
feat(sdk-trace-web): web worker support (#2719)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-20 22:33:54 +01:00
Sebastian Poxhofer e32879abbc
feat(otlp-exporter-http): change otlp-http port to canonical 4318 (#2557)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-01-20 08:57:46 -05:00
legendecas 8bda25ca9e
docs(api-metrics): add notes on ObservableResult.observe (#2712)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-01-20 00:30:14 +08:00
legendecas 1577f3536f
feat(sdk-metrics-base): implement async instruments support (#2686)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-01-19 23:31:28 +08:00
Yaniv Davidi 395fb0428b
docs: document node v10 EOL (#2720)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-18 17:50:56 +01:00
legendecas 206a1c3c1a
test(sdk-metrics): browser compatibility tests (#2709) 2022-01-19 00:04:21 +08:00
legendecas 21fc8b5280
feat(instrumentation-http): add options to ignore requests (#2704)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-17 10:35:42 +01:00
Mitar Milanovic d315b0a75e
fix: span attribute count and value limits (#2671) (#2678)
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: legendecas <legendecas@gmail.com>
2022-01-12 23:41:17 +08:00
legendecas 82e39c470a
chore: apply eslint rule semi (#2710) 2022-01-12 00:07:40 +08:00
legendecas 4909cf122a
fix(sdk-metrics-base): remove aggregator.toMetricData dependency on AggregationTemporality (#2676)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-11 00:50:08 +08:00
legendecas 6b94e26022
feat(sdk-metrics-base): meter registration (#2666) 2022-01-08 22:36:52 +01:00
Marc Pichler 354c002283
feat(metric-reader): add metric-reader (#2681) 2022-01-07 13:48:39 -05:00
legendecas d61f7bee0f
refactor: unifying shutdown once with BindOnceFuture (#2695)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-07 01:20:45 +08:00
Nikolay Lagutko 5f3cbc2c2d
fix(propagator-jaeger): 0-pad span-id to match 16-symbol validation (#2694)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2022-01-05 14:21:08 -05:00
Daniel Dyla fb2031be6b
chore: add Chengzhong Wu as maintainer (#2702) 2022-01-05 14:43:01 +01:00
Daniel Dyla dce6eb7abc
chore: add Amir Blum as maintainer (#2703)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2022-01-05 08:27:06 -05:00
Daniel Dyla 9a727f8b21
chore: add Rauno Viskus as maintainer (#2701) 2022-01-05 10:05:26 +01:00
Rauno Viskus 3d5447defa
chore: rename `--include-filtered-dependencies` (#2699) 2022-01-04 14:54:48 -05:00
legendecas af377fa4e0
chore: retry link checks on code 429 with 'retry-after' header (#2693) 2021-12-30 10:42:10 +01:00
legendecas eba315b6a2
feat(api-metrics): remove observable types (#2687)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-28 22:34:51 +01:00
legendecas 0e9f8af8cc
chore: checks links in typedoc html (#2669)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-28 16:06:21 -05:00
Srikanth Chekuri bef840b55b
feat(sdk-metrics-base): bootstrap metrics exemplars (#2641)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-28 16:05:08 -05:00
sschegolev ddede49309
feat(@opentelemetry/propagator-jaeger): support custom baggage prefix (#2673)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-28 11:29:13 +01:00
Mitar Milanovic 315abae2fb
fix: span events count limit when set to 0 (#2679)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-12-27 10:23:10 -05:00
Daniel Dyla f010fa302a
docs: update typedoc config (#2688)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-12-25 13:52:55 +01:00
legendecas 5d22abacae
fix: remove window and document dependencies in web packages (#2689)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-12-24 16:54:18 +01:00
Daniel Dyla 50252a90bc
chore: start a style guide (#2683)
Co-authored-by: legendecas <legendecas@gmail.com>
2021-12-23 12:55:08 -05:00
Daniel Dyla d9e12e24b2
chore: remove @obecny as maintainer (#2684) 2021-12-22 21:01:43 +01:00
Marc Pichler 7578e50028
docs: remove circle-ci from development guide, update link, and fix typo. (#2685) 2021-12-22 12:51:31 -05:00
Rauno Viskus 89f862b284
chore: bump otlp trace exporters to v1 (#2626)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-21 14:04:01 -05:00
Nev 8b9935b937
fix: tracer typo in fetchxhr examples (#2680) 2021-12-21 13:14:51 -05:00
Svetlana Brennan 2c8601fe9d
Update metrics example (#2658)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-18 11:04:55 +01:00
legendecas 27bbb11cde
feat(sdk-metrics): bootstrap metric streams (#2636) 2021-12-17 08:12:34 -05:00
Nev 10cd9163a0
chore: update and fix tracer-web examples (#2661) 2021-12-15 11:05:40 -05:00
legendecas f59c5b268b
chore: add markdown link checks (#2657)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-12-11 21:31:36 +01:00
echoontheway b804d9bff7
chore: add esm2015 entry for web apps aiming at modern browsers (#2556) 2021-12-11 20:02:47 +01:00
Daniel Dyla dded3f8c0f
chore: fix nojekyll in docs command (#2663) 2021-12-10 15:09:54 -05:00
legendecas a35f09362a
feat(metrics-sdk): bootstrap aggregation support (#2634)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-09 09:24:18 -05:00
bgpo f51f8531b9
fix: clientMethodTrace missing original properties (#2650) 2021-12-08 12:31:47 -05:00
Daniel Dyla 09d3f6887a
Update nock (#2652)
Co-authored-by: Cole Easton <coleasto@amazon.com>
2021-12-07 14:05:50 -05:00
legendecas 6724a1bfe5
docs: fix links to the context document (#2651)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-12-06 14:52:33 -05:00
Svetlana Brennan f95debab3a
chore: update opentelemetry dependencies to latest versions (#2647)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-12-06 19:19:20 +01:00
Ricky Zhou b9e7835716
refactor(opentelemetry-sdk-node): remove redundant judgments for metric (#2648) 2021-12-06 11:50:30 -05:00
Daniel Dyla 3959386463
feat: spec compliant metric creation and sync instruments (#2588) 2021-12-01 11:13:18 -05:00
Daniel Dyla 14afcc1f7b
chore: Update wip metrics references (#2638) 2021-11-27 13:59:45 +01:00
legendecas 5e9c7e1cb6
feat(api-metrics): async instruments spec compliance (#2569)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-11-22 16:58:51 +01:00
legendecas 9b5feb2f21
feat(metrics-sdk): bootstrap views api (#2625)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-11-21 21:28:49 +01:00
Daniel Dyla 13acbd3675
chore: rename metrics packages to prevent lerna linking (#2629) 2021-11-20 09:10:35 +01:00
Ali Sabzevari a58f510ed0
chore(sdk-trace-web): fix lint warnings (#2451)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-17 17:21:19 +01:00
WhiteSource Renovate 58bfe2563b
chore(deps): pin dependencies (#2616) 2021-11-17 10:22:19 -05:00
Daniel Dyla d128f0ff4e
chore: fix the compilation for typescript 4.4 (#2623) 2021-11-15 21:14:02 +01:00
WhiteSource Renovate b9dffcafd3
chore(deps): update all non-major dependencies (#2449) 2021-11-15 14:25:43 -05:00
Daniel Dyla 6b77b679ca
feat: add WIP metrics SDK (#2601)
Co-authored-by: Georg Pirklbauer <georg.pirklbauer@dynatrace.com>
2021-11-15 08:52:56 -05:00
Daniel Dyla 7d67bf3e3e
chore: Remove old metrics SDK (#2598) 2021-11-11 11:56:42 -05:00
Daniel Dyla 0bc25fa930
chore: fix compilation errors (#2614) 2021-11-11 11:17:13 -05:00
Daniel Dyla 9cf402ee42
chore: release proposal v1.0.1 / v0.27.0 (#2611) 2021-11-11 09:15:45 -05:00
Ali Sabzevari fdab6422ae
chore: Fix lint warnings in instrumentation package (#2404) 2021-11-10 14:02:30 -05:00
Rauno Viskus e8e787d60f
chore: regularly close stale issues (#2533)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-10 12:36:40 -05:00
Patrice Chalin 2e378fd87e
Use new canonical path to Getting Started (#2561)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-10 11:22:45 -05:00
Bartlomiej Obecny 61cfbfedff
fix: preventing double enable for instrumentation that has been already enabled (#2610) 2021-11-10 10:20:04 +01:00
Antoine Pultier bc50c7b8e8
feat: lazy initialization of the gzip stream (#2581) 2021-11-09 13:43:29 -05:00
legendecas 1abda1437c
chore: update npm badge image links (#2607) 2021-11-09 13:18:29 -05:00
Bartlomiej Obecny e8d65f22d2
chore: adding selenium tests with browserstack (#2570)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-11-08 17:05:38 -05:00
WhiteSource Renovate 8227258b4a
chore(deps): update commitlint monorepo to v14 (major) (#2602) 2021-11-08 13:05:04 -05:00
WhiteSource Renovate 70004c4947
chore(deps): update dependency sinon to v12 (#2603) 2021-11-08 09:14:10 -05:00
Georg Pirklbauer 517a31a4f6
feat: Rename Labels to Attributes (#2523)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-08 09:02:29 -05:00
James 28c9e88294
Docs: Document the HrTime format (#2604) 2021-11-05 15:03:29 -04:00
Bartlomiej Obecny 491dd807d1
fix: fixing compatibility versions for detectors (#2584)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-05 14:49:50 -04:00
Olivier Albertini 03709c7bda
docs(instrumentation): update links in the Readme (#2576) 2021-11-05 14:20:03 -04:00
WhiteSource Renovate c8272749e1
fix(deps): update dependency @opentelemetry/resource-detector-aws to v1 (#2573) 2021-11-05 09:40:35 -04:00
WhiteSource Renovate 37483bcac7
chore(deps): update dependency karma to v6 (#1826) 2021-11-05 09:08:59 -04:00
Dylan Arbour a1b47ac440
docs: fix URLs in README post-experimental move (#2600) 2021-11-04 13:05:29 -04:00
(Eliseo) Nathaniel Ruiz Nowell 85d5110384
doc: Move upgrade propagator notes to correct section (#2579)
* Move upgrade propagator notes to correct section

* Fix the named reference to HttpBaggagePropagator

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>

* Update README.md

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
2021-11-02 21:42:09 +01:00
Daniel Dyla 0d0b668de8
feat!(metrics): remove batch observer (#2566) 2021-11-02 15:10:06 -04:00
legendecas 5bb83224be
feat(api-metrics): remove bind/unbind and bound instruments (#2559)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-02 14:14:48 -04:00
William Armiros c307949125
feat!: Split metric and trace exporters into new experimental packages (#2485)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2021-11-02 13:16:41 -04:00
legendecas 4e311bd84e
feat(sdk-metrics-base): remove per-meter config on MeterProvider.getMeter (#2563)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-11-02 09:12:10 +01:00
legendecas 61cf8c5ec1
feat(api-metrics): add schemaUrl to meter creations (#2529) 2021-11-01 11:51:33 -04:00
Valentin Marchaud 357ec92e95
chore(doc): update matrix with contrib version for 1.0 core (#2568) 2021-10-27 22:15:55 +02:00
Gerhard Stöbich fa0cb7270e
chore(deps): pin minor API version (#2531)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-10-27 09:02:40 -04:00
Gerhard Stöbich 5de52ee319
chore: cleanup setting config in instrumentations (#2522)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-10-27 09:50:51 +02:00
moander c0ab95266a
fix(core): support regex global flag in urlMatches (#2560)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-10-27 09:44:15 +02:00
Jack c1939a79a9
fix(@opentelemetry/exporter-prometheus): unref prometheus server to prevent process running indefinitely (#2558) 2021-10-26 21:35:57 +02:00
moander b531acffbf
docs: expose existing comments (#2555) 2021-10-22 21:21:07 +02:00
legendecas 6a8c2f2094
fix: prefer globalThis instead of window to support webworkers (#2465)
* fix: prefer globalThis instead of window to support webworkers

There is no `window` in either WebWorkers and ServiceWorkers.

* Update packages/opentelemetry-core/test/platform/browser/environment.test.ts

* fixup! add globalThis helpers
2021-10-21 20:09:19 +02:00
legendecas 9df2132398
fix(sdk-metrics-base): remove metric kind BATCH_OBSERVER (#2540)
BATCH_OBSERVER is no longer a metric.
2021-10-21 20:05:10 +02:00
legendecas 3045eba229
chore: slim font size for section title in PR template (#2541) 2021-10-20 14:56:36 +02:00
Ivan Santos c160ad8b2a
chore: expand pull request template with action items (#2509)
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-17 18:25:28 +02:00
Severin Neumann f2a562430b
chore: remove getting started and link to documentation. (#2493)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-17 18:14:21 +02:00
echoontheway 043067fa3a
feat(@opentelemetry/semantic-conventions): change enum to object literals (#2532)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-17 18:09:02 +02:00
legendecas f9f43e565a
feat(api-metrics): rename metric instruments to match feature-freeze API specification (#2496)
* feat: rename metric instruments to match feature-freeze API specification

* fixup! rename observables

* fixup!

* fixup!

* fixup!

* fixup! observable naming

* fixup! remove unnecessary spaces

* fixup! add upgrade guidelines
2021-10-15 21:35:18 +02:00
WhiteSource Renovate 96dab9fc12
chore(deps): update typescript-eslint monorepo to v5 (#2537) 2021-10-15 21:28:30 +02:00
Bartlomiej Obecny df12218cc4
feat: new merge function (#2484)
* feat: new merge function

* chore: updating info about lodash.merge util
2021-10-13 01:33:24 +02:00
legendecas ed0ba063ae
fix(sdk-metrics-base): metrics name should be in the max length of 63 (#2495)
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-10 20:59:43 +02:00
echoontheway faca317da1
feat(@opentelemetry-instrumentation-fetch): support reading response body from the hook applyCustomAttributesOnSpan (#2497)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-09 16:10:46 +02:00
MartenH d3f5163267
chore(deps): remove unused semver (#2520)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-09 16:01:36 +02:00
t2t2 8d43324871
fix(exporter-zipkin): correct status tags names (#2519)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-09 15:57:36 +02:00
Weyert de Boer 0c7f1c3ae9
feat: upgrade semantic-conventions to latest v1.7.0 spec (#2528)
Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
2021-10-09 15:45:43 +02:00
Daniel Dyla 0f5a5bc906
chore(experimental): v0.26.0 proposal (#2513) 2021-10-05 13:15:49 -04:00
WhiteSource Renovate 52d3f9b20e
fix(deps): update opentelemetry-js monorepo to v1 (major) (#2516) 2021-10-04 09:58:59 +02:00
Daniel Dyla f29434b0a3
chore: inline sources in source maps (#2488)
* chore: inline sources in source maps

* chore: sort tsconfig options

Co-authored-by: Nev <54870357+MSNev@users.noreply.github.com>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-10-01 13:55:55 -04:00
Daniel Dyla d15127c951
chore: update stable dependencies to 1.0 (#2514) 2021-10-01 17:05:19 +02:00
Daniel Dyla 69b925d142
chore: v1.0.0 proposal (#2468) 2021-09-30 16:40:20 -04:00
Daniel Dyla 6afe2fc308
chore(experimental): update stable deps to 26 (#2512) 2021-09-30 11:40:37 -04:00
Daniel Dyla fa2e897587
chore: v0.26.0 proposal (#2505)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-30 08:26:34 -04:00
legendecas a25e30a541
test: add esModuleInterop compatibility test (#2506)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-09-30 07:58:43 -04:00
Daniel Dyla 9ac1d8ed34
chore: fix cache paths for backcompat tests (#2511) 2021-09-30 10:41:52 +02:00
Paurush Garg 25e5ddea8a
fix: 2389- replaced logger unformatted strings with template literals (#2499) 2021-09-29 17:21:29 -04:00
Daniel Dyla b66c650849
chore: move backwards compatibility to experimental (#2508) 2021-09-29 10:53:40 -04:00
Mustafain Ali Khan 7287dcb042
fix: update typescript getting-started tracing example and docs (#2504) 2021-09-29 09:07:28 -04:00
Mustafain Ali Khan be52259d73
fix: remove setting http.route in http span attributes (#2494) 2021-09-28 13:49:47 -04:00
Daniel Dyla f0dc893b79
chore: mark otlp exporters experimental (#2490) 2021-09-27 16:30:07 -04:00
Siim Kallas d41fa7bdea
feat: HTTP instrumentation: add the option to capture headers as span attributes (#2492) 2021-09-27 16:16:01 -04:00
Mustafain Ali Khan 33935e78aa
fix: remove usage of serviceName property in tests for otel collector (#2491) 2021-09-25 14:54:45 +02:00
legendecas 6a78db163f
chore: mark @opentelemetry/exporter-prometheus as experimental (#2479)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-22 08:56:02 -04:00
Jessica Kerr 20cb74a7b2
Update links to packages moved to experimental (#2478) 2021-09-22 14:12:10 +02:00
Daniel Dyla bebd82a7f1
chore!: rename collector exporters (#2476)
* chore!: rename collector exporters

* chore: finish renaming

* chore: finish renaming

* chore: typo
2021-09-15 20:41:08 +02:00
Daniel Dyla 745bd5c34d
chore: move sdk-node to experimental (#2473)
* chore: move sdk-node to experimental

* chore: update ts references
2021-09-14 20:41:51 +02:00
Patrice Chalin 3a81389b93
Drop website_docs folder (#2469)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-09-14 11:53:52 -04:00
Daniel Dyla 0f004daea6
chore: move missed test file to its package (#2474) 2021-09-14 11:22:56 -04:00
Daniel Dyla 07b19ad19e
chore: split stable and experimental packages into groups using directories (#2462)
* chore: split stable and experimental packages into groups

* chore: use experimental directory

* chore: remove release-please
2021-09-10 17:14:55 -04:00
James 5fefbb2748
docs(README): Fix links in README.md (#2463)
* docs(readme): fix-readme-typedoc-links

* Fix the absolute link for Benchmarks

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2021-09-10 00:59:19 +02:00
Asaf Ben Aharon a1875b6785
feat(instrumentation-http): add diag debug on http request events (#2126)
* feat: add diag debug on http request events

* Update packages/opentelemetry-instrumentation-http/src/http.ts

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>

* Update packages/opentelemetry-instrumentation-http/src/http.ts

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>

* fix: _diag private

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
2021-09-10 00:34:04 +02:00
Banothu Ramesh Naik feea5167c1
feat(opentelemetry-sdk-trace-base): implemented general limits of attributes (#2430)
* feat(opentelemetry-sdk-trace-base): implemented general limits of attributes

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): type caste issue fixed

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

Co-authored-by: Rauno Viskus <Rauno56@users.noreply.github.com>
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-09-09 00:12:02 +02:00
Ran Nozik 3acebdcc07
fix: handle missing package.json file when checking for version (#2450)
* feat: handle missing version case

* feat: add test cases

* fix: cr comment

* fix: add comment to test

* fix: tests description
2021-09-08 16:47:30 +02:00
Weyert de Boer bec77913bc
feat: upgrade semantic conventions to the latest 1.6.1 version (#2456)
Regenerated the `@opentelemetry-js/semantic-conventions`-package to use
the latest definitions from the Opentelemetry specification

Co-authored-by: Weyert de Boer <weyert.deboer@tapico.io>
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-06 20:59:34 +02:00
Ali Sabzevari 7b01cfa78c
chore(instrumentation-fetch): fix lint warnings (#2454)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-04 11:29:14 +02:00
Ali Sabzevari 6617573888
chore(instrumentation-http): fix lint warnings (#2455)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-04 11:22:50 +02:00
Ali Sabzevari 7dc2538759
chore(sdk-node): fix lint warnings (#2453)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-04 11:11:59 +02:00
Ali Sabzevari ec90f10bf8
chore(exporter-collector): fix lint warnings (#2452)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-04 11:05:50 +02:00
Ali Sabzevari 63f6701081
chore(sdk-trace): fix lint warnings (#2446)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-09-04 10:02:51 +02:00
Ali Sabzevari f81077946a
chore(exporter): fix lint warnings (#2447)
* chore(shim): fix lint warnings

* chore(exporter-prometheus): fix lint warnings

* chore(exporter-zipkin): fix lint warnings
2021-09-03 19:53:17 +02:00
Long Mai dc574f7168
feat: OTEL_EXPORTER_OTLP_ENDPOINT append version and signal (#2438)
* fix(@opentelemetry/exporter-collector): OTEL_EXPORTER_OTLP_ENDPOINT append version and signal

collector convention of appending the version and signal to the path
(e.g. v1/traces or v1/metrics), if not present already

* docs: update exporter collector readme

* docs: update exporter readme

* refactor: append util

* fix: lint on readme

Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
2021-08-31 14:19:44 -04:00
Daniel Dyla f0caa22ffc
chore: add release-please automation (#2431)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-08-30 16:37:19 -04:00
Aaron Abbott 7d2c4aaeb0
fix!: remove 'Http' from W3C propagator names (#2429) 2021-08-30 16:19:20 -04:00
Banothu Ramesh Naik 1465865e48
docs(examples): updated examples readme links (#2437)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-08-30 10:08:52 +02:00
Daniel Dyla facd8c0fb9
chore: simplify unit test cache (#2435)
Co-authored-by: Valentin Marchaud <contact@vmarchaud.fr>
2021-08-30 10:01:57 +02:00
Philip Szalla dbfabd2bff
fix(opentelemetry-instrumentation-fetch): fixed override of headers (#2426)
* fix(opentelemetry-instrumentation-fetch): fixed override of headers

Signed-off-by: Philip Szalla <philip@szalla.de>

* style(opentelemetry-instrumentation-fetch): removed irritating comment

Signed-off-by: Philip Szalla <philip@szalla.de>

* test(opentelemetry-instrumentation-fetch): added tests for custom headers

Signed-off-by: Philip Szalla <philip@szalla.de>

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-08-27 19:11:30 -04:00
Patrice Chalin c69251e497
docs(website): support GH page links to canonical src (#2421)
Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-08-27 16:28:37 -04:00
Herman dfb597def8
Fix ReferenceError (#2434)
When OTEL_TRACES_SAMPLER is used without OTEL_TRACES_SAMPLER_ARG there would be a ReferenceError due to getSamplerProbabilityFromEnv being called above the definition of DEFAULT_RATIO.

```
ReferenceError: Cannot access 'DEFAULT_RATIO' before initialization
    at null.getSamplerProbabilityFromEnv (/app/node_modules/@opentelemetry/tracing/src/config.ts:91:58)
    at null.buildSamplerFromEnv (/app/node_modules/@opentelemetry/tracing/src/config.ts:71:44)
    at Object.<anonymous> (/app/node_modules/@opentelemetry/tracing/src/config.ts:38:12)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:784:16)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/app/node_modules/@opentelemetry/tracing/src/utility.ts:17:1)```
2021-08-27 20:17:11 +02:00
Rauno Viskus 4ff1c6cbf5
docs: make link to exporters filter only exporters (#2408) 2021-08-26 21:59:37 +02:00
WhiteSource Renovate 30733df5cb
fix(deps): roll back dependency @opentelemetry/instrumentation-express to ^0.24.0 (#2423)
Co-authored-by: Bartlomiej Obecny <bobecny@gmail.com>
2021-08-25 10:09:43 +02:00
WhiteSource Renovate 3cbd530f2e
chore(deps): update all non-major dependencies (#2424) 2021-08-24 21:29:51 +02:00
Ali Sabzevari c62ea117a6
eslint configuration for getting-started examples (#2297)
* chore: add eslint config to getting-started

* chore: apply lint on getting-started

* chore: fix strict rule in getting-started lint config

* chore: import examples eslintrc for getting-started eslint config

* chore: rearrage lint scripts in package.json

* chore: restore removed require from getting-started example

* chore: remove duplicate require in getting-started
2021-08-23 23:46:10 +02:00
Banothu Ramesh Naik 78a78c093c
feat(opentelemetry-sdk-trace-base): implemented option to limit length of values of attributes (#2418)
* chore(opentelemetry-sdk-trace-base): implemented option to limit length of values of attributes

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): pr suggested changes and code improvements

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): pr suggested changes

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): pr suggested changes on test cases

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): pr suggested changes

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

* fix(opentelemetry-sdk-trace-base): pr suggested changes

Signed-off-by: Banothu Ramesh Naik <rameshnaik5521@gmail.com>

Co-authored-by: Daniel Dyla <dyladan@users.noreply.github.com>
2021-08-23 23:37:50 +02:00
Gerhard Stöbich 5bb9fcc4db
chore(deps): remove shimmer from dependencies (#2425) 2021-08-23 17:15:52 -04:00
1672 changed files with 193197 additions and 38937 deletions

View File

@ -1,25 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
Please answer these questions before submitting a bug report.
### What version of OpenTelemetry are you using?
### What version of Node are you using?
### Please provide the code you used to setup the OpenTelemetry SDK
### What did you do?
If possible, provide a recipe for reproducing the error.
### What did you expect to see?
### What did you see instead?
### Additional context
Add any other context about the problem here.

139
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@ -0,0 +1,139 @@
name: Bug Report
description: File a bug report
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
> [!IMPORTANT]
> **Please read all parts of this form carefully.** By following the instructions carefully, you ensure that we
> can get started fixing your bug, instead of being stuck at trying to reproduce your issue. Please provide
> all requested information, even if you think it does not apply to your problem.
>
> **If you use a third-party package that re-distributes OpenTelemetry, open the bug ticket with that third party unless you can provide steps to reproduce this with pure OpenTelemetry.**
> Digging into third-party distributions of OpenTelemetry is not in scope for this project.
Before filing a bug, please be sure you have searched through [existing open bugs](https://github.com/open-telemetry/opentelemetry-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug)
to see if this bug has already been filed.
- type: markdown
attributes:
value: |
## Bug Reproduction
- type: textarea
attributes:
label: What happened?
description: |
> [!IMPORTANT]
> **Please provide as much detail as you reasonably can.**
> We all know the complexities of developing with JavaScript/TypeScript. **Be specific** about your setup and **DO NOT** assume that the person handling your bug report knows how to use your specific combination of tooling. Always provide build instructions and config files.
value: |
## Steps to Reproduce
<!--
The most effective way to solve a bug is to provide a link to a reproducer repository. It is extremely difficult to exactly reproduce problems
and doing so can take multiple hours for us. You know your tooling and setup and we know OpenTelemetry JavaScript internals.
Let's help each other! :)
-->
## Expected Result
## Actual Result
## Additional Details
<!--
Anything you can think of that will help us reproduce and understand your problem:
- details about the behavior of the bug
- code to reproduce, if not provided via a repository above (including setting up any frameworks you may be using, we likely don't use the same tech-stack that you're using on the daily)
- which tooling you use and how you're using it
- config files for your tooling (typescript, bundlers, ...)
- how you run your code (example: `node -r otel.js ./index.js`).
- which module type you are you using (`module` or `commonjs`)
-->
validations:
required: true
- type: textarea
attributes:
label: OpenTelemetry Setup Code
description: |
Please provide the code you use to set up OpenTelemetry.
If you use `@opentelemetry/auto-instrumentations-node/register`, please state so here.
You may omit this step if you have provided a reproducer repository.
placeholder: | # This comes from our README.md
// otel.js
'use strict'
const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
const { resourceFromAttributes } = require('@opentelemetry/resources');
const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const traceExporter = new ConsoleSpanExporter();
const sdk = new opentelemetry.NodeSDK({
resource: resourceFromAttributes({
[ATTR_SERVICE_NAME]: 'my-service',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()]
});
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
.then(() => console.log('Tracing initialized'))
.catch((error) => console.log('Error initializing tracing', error));
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
sdk.shutdown()
.then(() => console.log('Tracing terminated'))
.catch((error) => console.log('Error terminating tracing', error))
.finally(() => process.exit(0));
});
render: "JavaScript"
- type: textarea
attributes:
label: package.json
description: |
Please provide your the full package.json needed to reproduce the issue.
You may omit this step if you provided a reproducer repository.
render: "JSON"
placeholder: |
{
"name": "my-app",
"scripts": {
"start": "node -r otel.js app.js"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/sdk-trace-base": "~1.3.1",
...
}
}
- type: textarea
attributes:
label: Relevant log output
description: |
Please copy and paste any relevant log output.
render: shell
- type: markdown
attributes:
value: |
## System Details
System Details help us when we cannot reproduce your problem with the information provided above. Sometimes bugs only surface on specific platforms and runtime versions.
- type: textarea
attributes:
label: Operating System and Version
placeholder: Ubuntu 24.04, Windows 11 Build 26100.2033, macOS 15.0.1
validations:
required: false
- type: textarea
attributes:
label: Runtime and Version
placeholder: Node.js v20.12.1, Node.js v18.18.2, Firefox 130, Chrome 132, ...
validations:
required: false

View File

@ -7,7 +7,7 @@ Before creating a pull request, please make sure:
- You have read the guide for contributing
- See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
- You signed all your commits (otherwise we won't be able to merge the PR)
- See https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#sign-the-cla
- See https://github.com/open-telemetry/community/blob/main/guides/contributor#sign-the-cla
- You added unit tests for the new functionality
- You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close
the issue that your PR fixes (if such)
@ -15,8 +15,29 @@ Before creating a pull request, please make sure:
## Which problem is this PR solving?
-
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
## Short description of the changes
-
## Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
## How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
- [ ] Test A
## Checklist:
- [ ] Followed the style guidelines of this project
- [ ] Unit tests have been added
- [ ] Documentation has been updated

45
.github/repository-settings.md vendored Normal file
View File

@ -0,0 +1,45 @@
# Repository settings
This document describes any changes that have been made to the
settings for this repository beyond the [OpenTelemetry default repository
settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-configure-new-repository.md#repository-settings).
## General
No changes
## Collaborators and Teams
- There is currently no `javascript-triagers` role
- `javascript-maintainers` has `Admin` permission
## Branches
## Branch protection rules
### `main`
- Uncheck "Restrict who can push to matching branches"
- Check "Require merge queue"
- Build concurrency: 5
- Minimum pull requests to merge: 1 or after 5 minutes
- Maximum pull requests to merge: 5
- Check "Only merge non-failing pull requests"
- Status check timeout: 60 minutes
### `dependabot/**/**`
There is currently not an explicit rule for this branch pattern.
Our dependencies are managed by a bot which creates PRs from a fork.
### `gh-pages`
This is a special branch which we use to publish the automatically generated docs.
It is exempt from most protections.
- "Allow force pushes from everyone" (requires write permission)
## Pages
- Source: Deploy from a branch
- Branch: `gh-pages` `/ (root)`

55
.github/workflows/benchmark.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name: Benchmark Tests
on:
push:
branches: [ main ]
permissions:
contents: read
jobs:
benchmark-tests:
permissions:
contents: write # required for pushing benchmark results to gh-pages
strategy:
fail-fast: false
matrix:
node_version:
- "22"
runs-on: equinix-bare-metal
timeout-minutes: 10
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}
- run: npm install -g npm@latest
- name: Bootstrap
run: npm ci
- name: Build 🔧
run: npm run compile
- name: Benchmark tests
run: |
npm run test:bench
find . -name .benchmark-results.txt -exec cat {} + > combined_benchmarks.txt
- name: Store benchmark results
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'benchmarkjs'
output-file-path: combined_benchmarks.txt
gh-pages-branch: gh-pages
github-token: ${{ secrets.GITHUB_TOKEN }}
benchmark-data-dir-path: "benchmarks"
auto-push: true

View File

@ -1,61 +0,0 @@
name: Deploy Canary Release
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
# Fetch all history (needed for lerna / semantic release to correctly version)
fetch-depth: 0
# pulls all tags (needed for lerna / semantic release to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 14.x
registry-url: https://registry.npmjs.org
scope: '@opentelemetry'
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
npm run compile
- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --nohoist='zone.js'
npm run compile
- name: Publish
run: npx lerna publish --canary --yes --no-verify-access
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Push new version tag to github
- run: git push --tags

36
.github/workflows/changelog.yml vendored Normal file
View File

@ -0,0 +1,36 @@
# This action requires that any PR targeting the main and next branch should touch at
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
# Changelog" label to disable this action.
name: changelog
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main
- next
permissions:
contents: read
jobs:
changelog:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog')}}
steps:
- uses: actions/checkout@v4
- name: Check for CHANGELOG changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
then
echo "A CHANGELOG was modified. Looks good!"
else
echo "No CHANGELOG was modified."
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
false
fi

27
.github/workflows/close-stale.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 6 * * 1'
permissions:
contents: read
jobs:
stale:
permissions:
issues: write # required for closing stale issues
pull-requests: write # required for closing stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
days-before-stale: 60
days-before-close: 14
stale-issue-message: 'This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
close-issue-message: 'This issue was closed because it has been stale for 14 days with no activity.'
stale-pr-message: 'This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
close-pr-message: 'This PR was closed because it has been stale for 14 days with no activity.'
stale-issue-label: stale
stale-pr-label: stale
exempt-issue-labels: never-stale,bug
exempt-pr-labels: never-stale,bug

View File

@ -2,34 +2,31 @@ name: "CodeQL Analysis"
on:
workflow_dispatch:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * *'
push:
branches: [ main ]
pull_request:
permissions:
contents: read
jobs:
CodeQL-Build:
permissions:
security-events: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v3

View File

@ -0,0 +1,65 @@
name: Create or Update Release PR
on:
workflow_dispatch:
inputs:
release_type:
type: choice
description: Release type
options:
- patch
- minor
release_scope:
type: choice
description: Release Scope
options:
- experimental # all packages in experimental/packages
- sdk # all SDK packages, experimental and stable, excluding semantic conventions
- all # all release packages, including API, excluding semconv
- semconv # only semantic convention package
permissions:
contents: read
jobs:
create-or-update-release-pr:
runs-on: ubuntu-latest
steps:
- name: Fork
run: gh repo fork open-telemetry/opentelemetry-js
env:
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
repository: opentelemetrybot/opentelemetry-js
ref: main
token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
- name: Sync with upstream
run: |
git remote show origin
git remote add upstream https://github.com/open-telemetry/opentelemetry-js.git
git fetch upstream
git reset --hard upstream/main
git push origin main --force
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: package-lock.json
node-version: 22
- run: npm install -g npm@latest
- run: npm ci
- name: Create/Update Release PR
run: |
git config user.name opentelemetrybot
git config user.email 107717825+opentelemetrybot@users.noreply.github.com
npm run github:create_or_update_release_pr
env:
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
RELEASE_SCOPE: ${{ github.event.inputs.release_scope }}
RELEASE_KIND: ${{ github.event.inputs.release_scope }}:${{ github.event.inputs.release_type }}
RELEASE_PR_REMOTE: origin
RELEASE_PR_OWNER: opentelemetrybot

View File

@ -4,51 +4,40 @@ on:
release:
types: [published]
permissions:
contents: read
jobs:
build-and-deploy:
permissions:
contents: write # required for deploying documentation to gh-pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: '14'
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-unit_test-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
npm run compile
node-version: '22'
- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
- name: Install and Build 🔧
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --nohoist='zone.js'
npm ci
npm run compile
- name: Build Docs
run: npm run docs
env:
NODE_OPTIONS: --max-old-space-size=6144
- name: Deploy Documentation 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs # The folder the action should deploy.
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
# ensure we don't override benchmark data
clean-exclude: |
benchmarks/**

76
.github/workflows/e2e.yml vendored Normal file
View File

@ -0,0 +1,76 @@
name: E2E Tests
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
e2e-tests:
strategy:
fail-fast: false
matrix:
node_version:
- "18.19.0"
- "18"
- "20.6.0"
- "20"
- "22"
- "23"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}
# npm@11.0.0 drops support for Node.js v18
# Install the latest npm compatible with this version of Node.js
# - npm@11.1.0 supports: {"node":"^20.17.0 || >=22.9.0"}
- run: npm install -g npm@"<11.0.0"
if: ${{
matrix.node_version == '18.19.0' ||
matrix.node_version == '18' ||
matrix.node_version == '20.6.0'
}}
- run: npm install -g npm@latest
if: ${{
matrix.node_version == '20' ||
matrix.node_version == '22' ||
matrix.node_version == '23'
}}
- name: Bootstrap
run: npm ci
- name: Build 🔧
run: npm run compile
- name: Install collector
run: |
curl -sSL -o otelcol-contrib.tar.gz https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.126.0/otelcol-contrib_0.126.0_linux_amd64.tar.gz
tar -xzf otelcol-contrib.tar.gz
working-directory: e2e-tests
- name: run collector in background
run: |
./otelcol-contrib --config collector-config.yaml &
working-directory: e2e-tests
- name: Export telemetry to collector
run: npm run export-telemetry
working-directory: e2e-tests
- name: stop collector
run: pkill -f otelcol-contrib
working-directory: e2e-tests
- name: Print output
run: cat collector-output.json
working-directory: e2e-tests
- name: verify exported telemetry
run: npm run verify
working-directory: e2e-tests

20
.github/workflows/fossa.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: FOSSA scanning
on:
push:
branches:
- main
permissions:
contents: read
jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: fossas/fossa-action@93a52ecf7c3ac7eb40f5de77fd69b1a19524de94 # v1.5.0
with:
api-key: ${{secrets.FOSSA_API_KEY}}
team: OpenTelemetry

View File

@ -5,60 +5,35 @@ on:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint changelog file
uses: avto-dev/markdown-lint@v1
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# Commenting due to
# https://github.com/avto-dev/markdown-lint/blob/aab9be9823fcd706f6da3e6ad6c64874c23fbd4c/lint/rules/changelog.js#L51-L71
# TODO: adhere to, or overwrite above rule and uncomment rules
# rules: "/lint/rules/changelog.js"
config: "/lint/config/changelog.yml"
args: "./CHANGELOG.md"
- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
args: "./**/*.md -i ./CHANGELOG.md"
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
# increment the trailing number to break the cache manually
key: ${{ runner.os }}-lint-${{ hashFiles('**/package.json') }}-0
node-version: '22'
# On a cache hit, use ci to speed up the install process
- name: Bootstrap (cache hit)
if: steps.cache.outputs.cache-hit == 'true'
run: |
npm ci --ignore-scripts
npx lerna bootstrap --ignore-scripts --hoist --nohoist='zone.js'
# On a cache miss, fall back to a regular install
- name: Bootstrap (cache miss)
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --ignore-scripts --hoist --nohoist='zone.js' -- --only=dev
- name: Bootstrap
run: npm ci
- name: Lint
run: |
npm run lint
npm run lint:examples
- name: Lint doc files
run: |
npm run compile
NODE_OPTIONS=--max-old-space-size=6144 npm run docs
npm run docs:test

47
.github/workflows/ossf-scorecard.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: OSSF Scorecard
on:
push:
branches:
- main
schedule:
- cron: "44 18 * * 6" # once a week
workflow_dispatch:
permissions: read-all
jobs:
analysis:
runs-on: ubuntu-latest
permissions:
# Needed for Code scanning upload
security-events: write
# Needed for GitHub OIDC token if publish_results is true
id-token: write
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
with:
results_file: results.sarif
results_format: sarif
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable
# uploads of run results in SARIF format to the repository Actions tab.
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: "Upload artifact"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
with:
sarif_file: results.sarif

View File

@ -1,22 +0,0 @@
name: Ensure API Peer Dependency
on:
push:
branches:
- main
pull_request:
jobs:
peer-api-check:
runs-on: ubuntu-latest
container:
image: node:14
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install lerna
run: npm install -g lerna
- name: Check API dependency semantics
run: lerna exec --ignore propagation-validation-server "node ../../scripts/peer-api-check.js"

30
.github/workflows/peer-api.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Ensure API Peer Dependency
on:
push:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
jobs:
peer-api-check:
runs-on: ubuntu-latest
container:
image: node:22
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install lerna
run: npm install -g lerna@6.6.2
- name: Install semver
run: npm install -g semver
- name: Check API dependency semantics
working-directory: packages
run: lerna run peer-api-check

44
.github/workflows/publish-to-npm.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Publish packages to NPM
on:
workflow_dispatch:
permissions:
contents: read
jobs:
release-to-npm:
runs-on: ubuntu-latest
permissions:
# needed for NPM provenance
id-token: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm ci
# NOTE: in the past, we've had situations where the compiled files were missing as the `prepublishOnly` script was
# missing in some packages. `npx lerna publish` *should* also run compile, but this is intended as a safeguard
# when that does not happen for whatever reason.
- run: npm run compile
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
NPM_CONFIG_PROVENANCE: true
# NOTE: using --concurrency 1 to reduce the likelihood of a race when publishing,
# which happens when the npm registry is not fully consistent yet. This can cause the publishing of a package to be
# rejected because dependencies are not available yet. `lerna` does ensure that this is not the case locally
# (packages are in-fact published in the correct order), but the race on the registry still applies.
# If this happens, run the workflow again - there should be enough time for everything to settle until this workflow
# attempts to publish again.
run: npx lerna publish --concurrency 1 from-package --no-push --no-private --no-git-tag-version --no-verify-access --dist-tag=latest --yes

79
.github/workflows/sbom.yml vendored Normal file
View File

@ -0,0 +1,79 @@
name: SBOM
on:
release:
types: [published]
permissions: read-all
jobs:
generate-sboms:
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g npm@latest
- name: Bootstrap
run: npm ci
- name: Generate SBOM for core packages
if: ${{ ! startsWith(github.ref, 'refs/tags/experimental') && ! startsWith(github.ref, 'refs/tags/api') }}
run: |
for dir in $(find packages -mindepth 1 -maxdepth 1 -type d)
do
dir_name=$(basename "$dir")
echo "Generating SBOM for $dir_name"
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
done
- name: Generate SBOM for the API package
if: startsWith(github.ref, 'refs/tags/api/')
run: |
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace api > opentelemetry-js_api.spdx.json
- name: Generate SBOMs for experimental packages
if: startsWith(github.ref, 'refs/tags/experimental/')
run: |
for dir in $(find experimental/packages -mindepth 1 -maxdepth 1 -type d)
do
dir_name=$(basename "$dir")
echo "Generating SBOM for $dir_name"
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
done
- name: Zip all SBOM files
run: |
zip sbom.zip *.spdx.json
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SBOM.zip
path: ./sbom.zip
add-release-artifact:
needs: generate-sboms
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact from generate-sboms
uses: actions/download-artifact@v4
with:
name: SBOM.zip
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./sbom.zip
asset_name: SBOM.zip
asset_content_type: application/zip

View File

@ -0,0 +1,44 @@
name: Survey on Merged PR by Non-Member
on:
pull_request_target:
types: [closed]
permissions:
contents: read
env:
PR_NUM: ${{ github.event.pull_request.number }}
SURVEY_URL: https://docs.google.com/forms/d/e/1FAIpQLSf2FfCsW-DimeWzdQgfl0KDzT2UEAqu69_f7F2BVPSxVae1cQ/viewform?entry.1540511742=open-telemetry/opentelemetry-js
jobs:
comment-on-pr:
name: Add survey to PR if author is not a member
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v4
- name: Check if user is a member of the org
id: check-membership
run: |
USERNAME=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
ORG="${{ github.repository_owner }}"
STATUS=$(gh api "orgs/$ORG/members/$USERNAME" --silent && echo "true" || echo "false")
if [[ "$STATUS" == "true" ]]; then
echo "MEMBER_FOUND=true" >> $GITHUB_ENV
else
echo "MEMBER_FOUND=false" >> $GITHUB_ENV
fi
env:
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
- name: Add comment to PR if author is not a member
if: env.MEMBER_FOUND == 'false'
run: |
USERNAME=$(jq -r '.pull_request.user.login' "$GITHUB_EVENT_PATH")
gh pr comment ${PR_NUM} --repo open-telemetry/opentelemetry-js --body "Thank you for your contribution @${USERNAME}! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this [survey](${SURVEY_URL})."
env:
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}

View File

@ -4,98 +4,157 @@ on:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
jobs:
unit-test:
node-tests:
strategy:
fail-fast: false
matrix:
node_version: ["8", "10", "12", "14", "16"]
node_version:
- "18.19.0"
- "18"
- "20.6.0"
- "20"
- "22"
- "23"
- "24"
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v4
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: ${{ matrix.node_version }}
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-unit_test-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
npm run compile
# npm@11.0.0 drops support for Node.js v18
# Install the latest npm compatible with this version of Node.js
# - npm@11.1.0 supports: {"node":"^20.17.0 || >=22.9.0"}
- run: npm install -g npm@"<11.0.0"
if: ${{
matrix.node_version == '18.19.0' ||
matrix.node_version == '18' ||
matrix.node_version == '20.6.0'
}}
- run: npm install -g npm@latest
if: ${{
matrix.node_version == '20' ||
matrix.node_version == '22' ||
matrix.node_version == '23' ||
matrix.node_version == '24'
}}
- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
- name: Bootstrap
run: npm ci
- name: Build 🔧
run: npm run compile
- run: npm test
if: ${{ matrix.node_version != '23' && matrix.node_version != '24' }}
# Node.js >= 23 type stripping conflicts with mocha usage of ts-node.
# See https://github.com/open-telemetry/opentelemetry-js/issues/5415
- run: npm test
env:
NODE_OPTIONS: '--no-experimental-strip-types'
if: ${{ matrix.node_version == '23' || matrix.node_version == '24' }}
- name: Report Coverage
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
node-windows-tests:
runs-on: windows-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: '22'
- run: npm install -g npm@latest
- name: Bootstrap
run: npm ci
- name: Build 🔧
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --nohoist='zone.js'
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
npm run compile
- name: Unit tests
run: npm run test
- name: Report Coverage
run: npm run codecov
if: ${{ matrix.node_version == '14' }}
browser-tests:
runs-on: ubuntu-latest
container:
image: circleci/node:14-browsers
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Permission Setup
run: sudo chmod -R 777 /github /__w
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-unit_test-${{ matrix.container }}-${{ hashFiles('**/package.json') }}
node-version: 22
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --hoist --nohoist='zone.js'
npm run compile
- name: Bootstrap
run: npm ci
- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
run: |
npm ci --ignore-scripts
npx lerna bootstrap --hoist --nohoist='zone.js'
npm run compile
- name: Build 🔧
run: npm run compile
- name: Unit tests
run: npm run test:browser
- name: Report Coverage
run: npm run codecov:browser
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true
webworker-tests:
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: |
package-lock.json
node-version: 22
- name: Bootstrap
run: npm ci
- name: Build 🔧
run: npm run compile
- name: Unit tests
run: npm run test:webworker
- name: Report Coverage
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
verbose: true

View File

@ -5,40 +5,30 @@ on:
branches:
- main
pull_request:
merge_group:
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: restore lock files
uses: actions/cache@master # must use unreleased master to cache multiple paths
id: cache
- uses: actions/setup-node@v4
with:
# must be done before bootstrap to not include node_modules files in the cache paths
path: |
cache: 'npm'
cache-dependency-path: |
package-lock.json
packages/*/package-lock.json
benchmark/*/package-lock.json
backwards-compatability/*/package-lock.json
metapackages/*/package-lock.json
packages/*/package-lock.json
integration-tests/*/package-lock.json
key: ${{ runner.os }}-w3c_integration-${{ hashFiles('**/package.json') }}
node-version: 18
- name: Install and Build (cache miss) 🔧
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install --ignore-scripts
npx lerna bootstrap --no-ci --scope=propagation-validation-server --include-dependencies
- name: Install and Bootstrap 🔧
run: npm ci
- name: Install and Build (cache hit) 🔧
if: steps.cache.outputs.cache-hit == 'true'
run: |
npm ci --ignore-scripts
npx lerna bootstrap --scope=propagation-validation-server --include-dependencies
- name: Generate version.ts files
run: npm run version:update
- name: Build 🔧
run: npm run compile

13
.gitignore vendored
View File

@ -1,9 +1,15 @@
# version.ts file is automatically generated at compile time
version.ts
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Filter Logs singal files
!experimental/examples/logs
# Runtime data
pids
@ -60,7 +66,6 @@ typings/
# lock files
yarn.lock
package-lock.json
# docs files
docs
@ -83,3 +88,9 @@ package.json.lerna_backup
#IDEA
.idea
*.iml
# non-aggregated benchmark results
.benchmark-results.txt
# release notes for release creation
.tmp/

7
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "packages/opentelemetry-exporter-collector-grpc/protos"]
path = packages/opentelemetry-exporter-collector-grpc/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
[submodule "packages/opentelemetry-exporter-collector-proto/protos"]
path = packages/opentelemetry-exporter-collector-proto/protos
[submodule "experimental/packages/otlp-transformer/protos"]
path = experimental/packages/otlp-transformer/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git

15
.markdownlint-cli2.jsonc Normal file
View File

@ -0,0 +1,15 @@
// https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
{
"config": {
// https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
"MD026": false,
"MD004": { "style": "dash" } // ul-style
},
"gitignore": true,
"noBanner": true,
"noProgress": true
}

View File

@ -1,7 +0,0 @@
{
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
"MD026": false
}

1
.mocharc.yml Normal file
View File

@ -0,0 +1 @@
require: 'ts-node/register'

1
.npmrc Normal file
View File

@ -0,0 +1 @@
lockfile-version=2

6
.nycrc
View File

@ -1,18 +1,20 @@
{
"produceSourceMap": false,
"extension": [
".ts"
],
"reporter": ["text", "json"],
"exclude": [
"**/*.d.ts",
"build/**/*.*",
"src/index.ts",
"src/platform/**/index.ts",
"src/platform/browser/*.ts",
"src/version.ts",
"test/**/*.*",
".eslintrc.js",
"karma.conf.js",
"webpack/*.js"
"webpack/*.js",
"src/generated/**"
],
"all": true
}

File diff suppressed because it is too large Load Diff

View File

@ -2,6 +2,25 @@
We'd love your help!
- [Development Quick Start](#development-quick-start)
- [Pull Request Merge Guidelines](#pull-request-merge-guidelines)
- [General Merge Requirements](#general-merge-requirements)
- [Report a bug or requesting feature](#report-a-bug-or-requesting-feature)
- [How to contribute](#how-to-contribute)
- [Before you start](#before-you-start)
- [Conventional commit](#conventional-commit)
- [Changelog](#changelog)
- [Fork](#fork)
- [Development](#development)
- [Tools used](#tools-used)
- [Install dependencies](#install-dependencies)
- [Compile modules](#compile-modules)
- [Running tests](#running-tests)
- [Linting](#linting)
- [Generating docs](#generating-docs)
- [Adding a package](#adding-a-package)
- [Platform conditional exports](#platform-conditional-exports)
## Development Quick Start
To get the project started quickly, you can follow these steps. For more
@ -10,11 +29,42 @@ detailed instructions, see [development](#development) below.
```sh
git clone https://github.com/open-telemetry/opentelemetry-js.git
cd opentelemetry-js
npm install
npm ci
npm run compile
npm test
npm run test
```
## Pull Request Merge Guidelines
Most pull requests MAY be merged by an approver OR a maintainer provided they meet the following [General Merge Requirements](#general-merge-requirements).
All requirements are at the discretion of the maintainers.
Maintainers MAY merge pull requests which have not strictly met these requirements.
Maintainers MAY close, block, or put on hold pull requests even if they have strictly met these requirements.
It is generally expected that a maintainer ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)) should review and merge major changes.
Some examples include, but are not limited to:
- API changes
- Breaking changes
- New modules
- Changes which affect runtime support
- New features which are not required by the specification
If a PR has not been interacted with by a reviewer within one week, please ping the approvers ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)).
### General Merge Requirements
- No “changes requested” reviews by approvers, maintainers, technical committee members, or subject matter experts
- No unresolved conversations
- Approved by at least one maintainer OR by at least one approver who is not the approver merging the pull request
- A pull request for small (simple typo, URL, update docs, or grammatical fix) changes may be approved and merged by the same approver
- For plugins, exporters, and propagators approval of the original code module author, or a contributor who has done extensive work on the module, is preferred but not required
- New or changed functionality is tested by unit tests
- New or changed functionality is documented if appropriate
- Substantial changes should not be merged within 24 hours of opening in order to allow reviewers from all time zones to have a chance to review
If all of the above requirements are met and there are no unresolved discussions, a pull request may be merged by either a maintainer or an approver.
## Report a bug or requesting feature
Reporting bugs is an important contribution. Please make sure to include:
@ -29,21 +79,41 @@ Reporting bugs is an important contribution. Please make sure to include:
### Before you start
Please read project contribution
[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
[guide](https://github.com/open-telemetry/community/blob/main/guides/contributor)
for general practices for OpenTelemetry project.
#### Conventional commit
The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages. You can see examples [here](https://www.conventionalcommits.org/en/v1.0.0-beta.4/#examples).
We use [commitlint](https://github.com/conventional-changelog/commitlint) and [husky](https://github.com/typicode/husky) to prevent bad commit message.
For example, you want to submit the following commit message `git commit -s -am "my bad commit"`.
You will receive the following error :
```text
✖ type must be one of [ci, feat, fix, docs, style, refactor, perf, test, revert, chore] [type-enum]
It is recommended to have your commit messages follow the Conventional Commits specification, with possible types listed in [.commitlint.rc.yml](.commitlintrc.yml). Here an example that uses the recommended format: `git commit -s -am "chore(opentelemetry-core): update deps"`
### Changelog
An entry into `CHANGELOG.md` or `experimental/CHANGELOG.md` is required for the following reasons:
- Changes made to the behaviour of the component
- Changes to the configuration
- Changes to default settings
- New components being added
It is reasonable to omit an entry to the changelog under these circumstances:
- Updating test to remove flakiness or improve coverage
- Updates to the CI/CD process
If there is some uncertainty with regards to if a changelog entry is needed, the recommendation is to create an entry to in the event that the change is important to the project consumers.
If a change does not require a changelog entry, the label `"Skip Changelog"` may be applied.
Pull requests with the `dependencies` label will be skipped by the changelog CI check.
If the change affects the overall project and not any individual package, it should usually go in the main changelog.
Changelog entries should be in the following format:
```md
* feat(subject): pull request title here #{pull request number} @{author github handle}
```
Here an exemple that will pass the verification: `git commit -s -am "chore(opentelemetry-core): update deps"`
Subject should describe the area of the project that was changed as descriptively as is possible in a short space.
For example, this may be the package name if a single package was updated or just `metrics` if both the metrics API and SDK are affected.
### Fork
@ -68,7 +138,7 @@ git merge upstream/main
Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#github-workflow) section of general project contributing guide.
## Development
@ -78,17 +148,16 @@ Please also see [GitHub workflow](https://github.com/open-telemetry/community/bl
- [TypeScript](https://www.typescriptlang.org/)
- [lerna](https://github.com/lerna/lerna) to manage dependencies, compilations, and links between packages. Most lerna commands should be run by calling the provided npm scripts.
- [MochaJS](https://mochajs.org/) for tests
- [gts](https://github.com/google/gts)
- [eslint](https://eslint.org/)
Most of the commands needed for development are accessed as [npm scripts](https://docs.npmjs.com/cli/v6/using-npm/scripts). It is recommended that you use the provided npm scripts instead of using `lerna run` in most cases.
### Install dependencies
This will install all dependencies for the root project and all modules managed by `lerna`. By default, a `postinstall` script will run `lerna bootstrap` automatically after an install. This can be avoided using the `--ignore-scripts` option if desired.
This will install all dependencies for the root project and all modules managed by `npm workspaces`.
```sh
npm install
npm ci
```
### Compile modules
@ -107,6 +176,9 @@ npm run clean
These commands can also be run for specific packages instead of the whole project, which can speed up compilations while developing.
**NOTE**: To run commands in specific packages (compile, lint, etc), please ensure you are using at least `7.x`
version of `npm`.
```sh
# Build a single module and all of its dependencies
cd packages/opentelemetry-module-name
@ -124,6 +196,15 @@ cd packages/opentelemetry-module-name
npm run watch
```
#### TypeScript version & update policy
TypeScript version used to compile the pacakges is `v5.0.4`. If you plan to use any of the packages from this
repository to make your own application or package instrumentation make sure to use same version or higher.
<!-- Ref: https://github.com/open-telemetry/opentelemetry-js/pull/5145#issuecomment-2518263890 -->
As update policy OpenTelemetry JS will follow DefinitelyType's [support policy for TypeScript](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window)
which sets a support window of 2 years.
### Running tests
Similar to compilations, tests can be run from the root to run all tests or from a single module to run only the tests for that module.
@ -137,9 +218,26 @@ cd packages/opentelemetry-module-name
npm test
```
To run the unit tests continuously in watch mode while developing, use:
```sh
# Run test in watch mode
npm run tdd
```
Packages that are expected to run in the browser have browser specific tests:
```sh
# Run browser-specific test
npm run test:browser
# Run web worker test
npm run test:webworker
```
### Linting
This project uses a combination of `gts` and `eslint`. Just like tests and compilation, linting can be done for all packages or only a single package.
This project uses `eslint` to lint source code. Just like tests and compilation, linting can be done for all packages or only a single package.
```sh
# Lint all modules
@ -161,52 +259,66 @@ cd packages/opentelemetry-module-name
npm run lint:fix
```
The default lint command will check majority of files, including Markdown files (such as README.md files), but you
also have the option to check just the Markdown files with:
```sh
npm run lint:markdown
npm run lint:markdown:fix # can automatically fix some Markdown rules
```
The default command doesn't check the examples folder. To lint just the examples, use the script:
```sh
npm run lint:examples
npm run lint:examples:fix # can automatically fix some errors
```
### Generating docs
We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.
To generate the docs, use:
```sh
# Generate docs in the root 'docs' directory
npm run docs
```
The document will be available under `docs` path.
### Adding a package
To add a new package, copy `packages/template` to your new package directory and modify the `package.json` file to reflect your desired package settings. If the package will not support browser, the `karma.conf` and `tsconifg.esm.json` files may be deleted. If the package will support es5 targets, the reference to `tsconfig.base.json` in `tsconfig.json` should be changed to `tsconfig.es5.json`.
After adding the package, run `npm install` from the root of the project. This will update the `tsconfig.json` project references automatically and install all dependencies in your new package. For packages supporting browser, file `tsconfig.esm.json` needs to be manually updated to include reference to ES modules build.
### Guidelines for Pull Requests
### Platform conditional exports
- Typically we try to turn around reviews within one to two business days.
- It is generally expected that a maintainer ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)) should review and merge every PR.
- If a change has met the requirements listed below, an approver may also merge the pull request.
- Most PRs should be merged in one to two weeks.
- If a PR is taking longer than 30 days, please ping the approvers ([@open-telemetry/javascript-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)) as it may have been lost
- Dependency upgrades and Security fixes: This PR is small and/or low-risk and can be merged with only maintainer reviews.
- If your patch is not getting reviewed or you need a specific person to review it, you can @username or @open-telemetry/javascript-approvers a reviewer asking for a review in the pull request.
- API changes, breaking changes, or large changes will be subject to more scrutiny and may require more reviewers. These PRs should only be merged by maintainers.
- Changes to existing plugins and exporters will typically require the approval of the original plugin/exporter author.
Universal packages are packages that can be used in both web browsers and
Node.js environment. These packages may be implemented on top of different
platform APIs to achieve the same goal. Like accessing the _global_ reference,
we have different preferred ways to do it:
### General Merge Requirements
- In Node.js, we access the _global_ reference with `globalThis` or `global`:
- All requirements are at the discretion of the maintainers.
- Maintainers may merge pull requests which have not strictly met these requirements.
- Maintainers may close, block, or put on hold pull requests even if they have strictly met these requirements.
- No “changes requested” reviews.
- No unresolved conversations.
- 3 approvals, including the approvals of at least 2 maintainers
- A pull request opened by an approver may be merged with only the 2 maintainer reviews.
- Small (simple typo, URL, update docs, or grammatical fix) or high-priority changes may be merged more quickly or with fewer reviewers at the discretion of the maintainers. This is typically indicated with the express label.
- For plugins, exporters, and propagators approval of the original code module author is preferred but not required.
- New or changed functionality is tested by unit tests.
- New or changed functionality is documented.
- Substantial changes should not be merged within 24 hours of opening in order to allow reviewers from all time zones to have a chance to review.
```js
/// packages/opentelemetry-core/src/platform/node/globalThis.ts
export const _globalThis = typeof globalThis === 'object' ? globalThis : global;
```
If all of the above requirements are met and there are no unresolved discussions, a pull request may be merged by either a maintainer or an approver.
- In web browser, we access the _global_ reference with the following definition:
### Generating API documentation
```js
/// packages/opentelemetry-core/src/platform/browser/globalThis.ts
export const _globalThis: typeof globalThis =
typeof globalThis === 'object' ? globalThis :
typeof self === 'object' ? self :
typeof window === 'object' ? window :
typeof global === 'object' ? global :
{} as typeof globalThis;
```
- `npm run docs` to generate API documentation. Generates the documentation in `packages/opentelemetry-api/docs/out`
### Generating CHANGELOG documentation
- Generate and export your [Github access token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token): `export GITHUB_AUTH=<your_token>`
- `npm run changelog` to generate CHANGELOG documentation in your terminal (see [RELEASING.md](RELEASING.md) for more details).
### Benchmarks
When two or more approaches must be compared, please write a benchmark in the benchmark/index.js module so that we can keep track of the most efficient algorithm.
- `npm run bench` to run your benchmark.
Even though the implementation may differ, the exported names must be aligned.
It can be confusing if exported names present in one environment but not in the
others.

537
README.md
View File

@ -2,11 +2,9 @@
---
<p align="center">
<strong>
<a href="getting-started/README.md">Getting Started</a>
<a href="https://opentelemetry.io/docs/languages/js/getting-started/">Getting Started</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="https://open-telemetry.github.io/opentelemetry-js-api">API Reference</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="https://open-telemetry.github.io/opentelemetry-js">SDK Reference</a>
<a href="https://open-telemetry.github.io/opentelemetry-js">API and SDK Reference</a>
</strong>
</p>
@ -21,21 +19,17 @@
<img alt="license" src="https://img.shields.io/badge/license-Apache_2.0-green.svg?style=for-the-badge">
</a>
<br/>
<a href="https://circleci.com/gh/open-telemetry/opentelemetry-js">
<img alt="Build Status" src="https://circleci.com/gh/open-telemetry/opentelemetry-js.svg?style=shield">
<a href="https://github.com/open-telemetry/opentelemetry-js/actions">
<img alt="Build Status" src="https://github.com/open-telemetry/opentelemetry-js/actions/workflows/unit-test.yml/badge.svg?style=shield">
</a>
<img alt="Beta" src="https://img.shields.io/badge/status-beta-informational?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAA8A2UOAAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABK5JREFUSA2dVm1sFEUYfmd2b/f2Pkqghn5eEQWKrRgjpkYgpoRCLC0oxV5apAiGUDEpJvwxEQ2raWPU+Kf8INU/RtEedwTCR9tYPloxGNJYTTQUwYqJ1aNpaLH3sXu3t7vjvFevpSqt7eSyM+/czvM8877PzB3APBoLgoDLsNePF56LBwqa07EKlDGg84CcWsI4CEbhNnDpAd951lXE2NkiNknCCTLv4HtzZuvPm1C/IKv4oDNXqNDHragety2XVzjECZsJARuBMyRzJrh1O0gQwLXuxofxsPSj4hG8fMLQo7bl9JJD8XZfC1E5yWFOMtd07dvX5kDwg6+2++Chq8txHGtfPoAp0gOFmhYoNFkHjn2TNUmrwRdna7W1QSkU8hvbGk4uThLrapaiLA2E6QY4u/lS9ItHfvJkxYsTMVtnAJLipYIWtVrcdX+8+b8IVnPl/R81prbuPZ1jpYw+0aEUGSkdFsgyBIaFTXCm6nyaxMtJ4n+TeDhJzGqZtQZcuYDgqDwDbqb0JF9oRpIG1Oea3bC1Y6N3x/WV8Zh83emhCs++hlaghDw+8w5UlYKq2lU7Pl8IkvS9KDqXmKmEwdMppVPKwGSEilmyAwJhRwWcq7wYC6z4wZ1rrEoMWxecdOjZWXeAQClBcYDN3NwVwD9pGwqUSyQgclcmxpNJqCuwLmDh3WtvPqXdlt+6Oz70HPGDNSNBee/EOen+rGbEFqDENBPDbtdCp0ukPANmzO0QQJYUpyS5IJJI3Hqt4maS+EB3199ozm8EDU/6fVNU2dQpdx3ZnKzeFXyaUTiasEV/gZMzJMjr3Z+WvAdQ+hs/zw9savimxUntDSaBdZ2f+Idbm1rlNY8esFffBit9HtK5/MejsrJVxikOXlb1Ukir2X+Rbdkd1KG2Ixfn2Ql4JRmELnYK9mEM8G36fAA3xEQ89fxXihC8q+sAKi9jhHxNqagY2hiaYgRCm0f0QP7H4Fp11LSXiuBY2aYFlh0DeDIVVFUJQn5rCnpiNI2gvLxHnASn9DIVHJJlm5rXvQAGEo4zvKq2w5G1NxENN7jrft1oxMdekETjxdH2Z3x+VTVYsPb+O0C/9/auN6v2hNZw5b2UOmSbG5/rkC3LBA+1PdxFxORjxpQ81GcxKc+ybVjEBvUJvaGJ7p7n5A5KSwe4AzkasA+crmzFtowoIVTiLjANm8GDsrWW35ScI3JY8Urv83tnkF8JR0yLvEt2hO/0qNyy3Jb3YKeHeHeLeOuVLRpNF+pkf85OW7/zJxWdXsbsKBUk2TC0BCPwMq5Q/CPvaJFkNS/1l1qUPe+uH3oD59erYGI/Y4sce6KaXYElAIOLt+0O3t2+/xJDF1XvOlWGC1W1B8VMszbGfOvT5qaRRAIFK3BCO164nZ0uYLH2YjNN8thXS2v2BK9gTfD7jHVxzHr4roOlEvYYz9QIz+Vl/sLDXInsctFsXjqIRnO2ZO387lxmIboLDZCJ59KLFliNIgh9ipt6tLg9SihpRPDO1ia5byw7de1aCQmF5geOQtK509rzfdwxaKOIq+73AvwCC5/5fcV4vo3+3LpMdtWHh0ywsJC/ZGoCb8/9D8F/ifgLLl8S8QWfU8cAAAAASUVORK5CYII=">
</p>
<p align="center">
<strong>
<a href="CONTRIBUTING.md">Contributing</a>
<a href="https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md">Contributing</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="doc/development-guide.md">Development Guide</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="benchmark/README.md">Benchmarks</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="examples/">Examples</a>
<a href="https://github.com/open-telemetry/opentelemetry-js/tree/main/examples">Examples</a>
</strong>
</p>
@ -43,37 +37,20 @@
## About this project
This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces and metrics from applications.
This is the JavaScript version of [OpenTelemetry](https://opentelemetry.io/), a framework for collecting traces, metrics, and logs from applications.
## Compatibility Matrix
## Quick Start
| API Version | Core version | Contrib Version |
| ----------- |--------------|-------------------------|
| 1.0.x | 0.25.x | ------ |
| 1.0.x | 0.24.x | 0.24.x |
| 1.0.x | 0.23.x | 0.23.x |
| 1.0.x | 0.22.x | 0.22.x |
| 0.21.x | 0.21.x | 0.21.x |
| 0.20.x | 0.20.x | 0.20.x |
| v1.0.0-rc.3 | 0.19.x | 0.16.x |
| 0.18.x | 0.18.x | 0.14.x |
| | 0.17.x | ------ |
| | 0.16.x | ------ |
| | 0.15.x | 0.13.x |
| | 0.14.x | 0.12.x |
| | 0.13.x | ------ |
| | 0.12.x | 0.11.x |
| | 0.11.x | 0.10.x |
**Much of OpenTelemetry JS documentation is written assuming the compiled application is run as CommonJS.**
For more details on ECMAScript Modules vs CommonJS, refer to [esm-support](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/esm-support.md).
## Versioning
The following describes how to set up tracing for a basic web application.
For more detailed documentation, see the website at <https://opentelemetry.io/docs/instrumentation/js/>.
The current version for each package can be found in the respective `package.json` file for that module. For additional details see the [versioning and stability][spec-versioning] document in the specification.
### Installation
## Quick start
### Application Owner
#### Install Dependencies
Dependencies with the `latest` tag on NPM should be compatible with each other.
See the [version compatibility matrix](#package-version-compatibility) below for more information.
```shell
npm install --save @opentelemetry/api
@ -83,7 +60,7 @@ npm install --save @opentelemetry/auto-instrumentations-node
**Note:** `auto-instrumentations-node` is a meta package from [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node) that provides a simple way to initialize multiple Node.js instrumentations.
#### Instantiate Tracing
### Set up Tracing
```js
// tracing.js
@ -94,15 +71,15 @@ const process = require('process');
const opentelemetry = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { resourceFromAttributes } = require('@opentelemetry/resources');
const { ATTR_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const traceExporter = new ConsoleSpanExporter();
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
resource: resourceFromAttributes({
[ATTR_SERVICE_NAME]: 'my-service',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()]
@ -110,9 +87,7 @@ const sdk = new opentelemetry.NodeSDK({
// initialize the SDK and register with the OpenTelemetry API
// this enables the API to record telemetry
sdk.start()
.then(() => console.log('Tracing initialized'))
.catch((error) => console.log('Error initializing tracing', error));
sdk.start();
// gracefully shut down the SDK on process exit
process.on('SIGTERM', () => {
@ -123,47 +98,121 @@ process.on('SIGTERM', () => {
});
```
#### Run Your Application
### Run Your Application
```shell
node -r ./tracing.js app.js
```
The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](getting-started/README.md). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing]
The above example will emit auto-instrumented telemetry about your Node.js application to the console. For a more in-depth example, see the [Getting Started Guide](https://opentelemetry.io/docs/languages/js/getting-started/). For more information about automatic instrumentation see [@opentelemetry/sdk-trace-node][otel-node], which provides auto-instrumentation for Node.js applications. If the automatic instrumentation does not suit your needs, or you would like to create manual traces, see [@opentelemetry/sdk-trace-base][otel-tracing]
### Library Author
## Library Author
If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an [Application Owner](#application-owner) uses a different SDK implementation.
If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an application owner uses a different SDK implementation.
## Supported Runtimes
| Platform Version | Supported |
|------------------|-------------------------------------------------|
| Node.JS `v16` | ✅ |
| Node.JS `v14` | ✅ |
| Node.JS `v12` | ✅ |
| Node.JS `v10` | ✅ |
| Node.JS `v8` | See [Node Support](#node-support) below |
| Web Browsers | ✅ See [Browser Support](#browser-support) below |
| Platform Version | Supported |
| ------------------- | --------------------------------------------- |
| Node.JS `v22` | :heavy_check_mark: |
| Node.JS `v20` | :heavy_check_mark: |
| Node.JS `v18` | :heavy_check_mark: |
| Older Node Versions | See [Node Support](#node-support) |
| Web Browsers | See [Browser Support](#browser-support) below |
### Node Support
Automated tests are run using the latest release of each currently active version of Node.JS.
While Node.JS v8 is no longer supported by the Node.JS team, the latest version of Node.JS v8 is still included in our testing suite.
Please note that versions of Node.JS v8 prior to `v8.5.0` will NOT work, because OpenTelemetry Node depends on the `perf_hooks` module introduced in `v8.5.0`
Only Node.js Active or Maintenance LTS versions are supported.
Previous versions of node *may* work, but they are not tested by OpenTelemetry and they are not guaranteed to work.
### Browser Support
Automated browser tests are run in the latest version of Headless Chrome.
There is currently no list of officially supported browsers, but OpenTelemetry is developed using standard web technologies with wide support and should work in currently supported versions of major browsers.
> [!IMPORTANT]
> Client instrumentation for the browser is **experimental** and mostly **unspecified**. If you are interested in
> helping out, get in touch with the [Client Instrumentation SIG][client-instrumentation-sig].
Rather than define versions of specific browsers / runtimes, OpenTelemetry sets the minimum supported version based on the
underlying language features used.
The current minumum language feature support is set as [ECMAScript 2022](https://262.ecma-international.org/13.0/) that are available
in all modern browsers / runtimes.
This means that if you are targeting or your end-users are using a browser / runtime that does not support ES2022, you will need
to transpile the code and provide any necessary polyfills for the missing features to ensure compatibility with your target
environments. Any support issues that arise from using a browser or runtime that does not support ES2022 will be closed as "won't fix".
This minimum support level is subject to change as the project evolves and as the underlying language features evolve.
## TypeScript Support
OpenTelemetry JavaScript is built with TypeScript `v5.0.4`. If you have a TypeScript project (app, library, instrumentation, etc.)
that depends on it, we recommend using same or higher version to compile the project.
OpenTelemetry JavaScript will follows DefinitelyType's [support policy for TypeScript](https://github.com/DefinitelyTyped/DefinitelyTyped#support-window) which sets a support window of 2 years. Support for TypeScript versions older than 2 years will be dropped in minor releases of OpenTelemetry JavaScript.
## Package Version Compatibility
OpenTelemetry is released as a set of distinct packages in 3 categories: API, stable SDK, and experimental.
The API is located at [/api](/api/), the stable SDK packages are in the [/packages](/packages/) directory, and the experimental packages are listed in the [/experimental/packages](/experimental/packages/) directory.
There may also be API packages for experimental signals in the experimental directory.
All stable packages are released with the same version, and all experimental packages are released with the same version.
The below table describes which versions of each set of packages are expected to work together.
| Stable Packages | Experimental Packages |
|-----------------|-----------------------|
| 2.0.x | 0.200.x |
| 1.30.x | 0.57.x |
| 1.29.x | 0.56.x |
| 1.28.x | 0.55.x |
| 1.27.x | 0.54.x |
| 1.25.x | 0.52.x |
<details>
<summary>Older version compatibility matrix</summary>
<table>
<tr><th>Stable Packages</th> <th>Experimental Packages</th></tr>
<tr><td>1.24.x</td> <td>0.51.x</td></tr>
<tr><td>1.23.x</td> <td>0.50.x</td></tr>
<tr><td>1.22.x</td> <td>0.49.x</td></tr>
<tr><td>1.21.x</td> <td>0.48.x</td></tr>
<tr><td>1.20.x</td> <td>0.47.x</td></tr>
<tr><td>1.19.x</td> <td>0.46.x</td></tr>
<tr><td>1.18.x</td> <td>0.45.x</td></tr>
<tr><td>1.17.x</td> <td>0.43.x, 0.44.x</td></tr>
<tr><td>1.16.x</td> <td>0.42.x</td></tr>
<tr><td>1.15.x</td> <td>0.41.x</td></tr>
<tr><td>1.14.x</td> <td>0.40.x</td></tr>
<tr><td>1.13.x</td> <td>0.39.x</td></tr>
<tr><td>1.12.x</td> <td>0.38.x</td></tr>
<tr><td>1.11.x</td> <td>0.37.x</td></tr>
<tr><td>1.10.x</td> <td>0.36.x</td></tr>
<tr><td>1.9.x</td> <td>0.35.x</td></tr>
<tr><td>1.8.x (this and later versions require API >=1.3.0 for metrics)</td><td>0.34.x</td></tr>
<tr><td>1.7.x</td> <td>0.33.x</td></tr>
<tr><td>1.6.x</td> <td>0.32.x</td></tr>
<tr><td>1.5.x</td> <td>0.31.x</td></tr>
<tr><td>1.4.x</td> <td>0.30.x</td></tr>
<tr><td>1.3.x</td> <td>0.29.x</td></tr>
<tr><td>1.2.x</td> <td>0.29.x</td></tr>
<tr><td>1.1.x</td> <td>0.28.x</td></tr>
<tr><td>1.0.x</td> <td>0.27.x</td></tr>
<tr><td>1.0.x (this and later versions require API >=1.0.0 for traces)</td><td>0.26.x</td></tr>
</table>
</details>
## Versioning
The current version for each package can be found in the respective `package.json` file for that module. For additional details see the [versioning and stability][spec-versioning] document in the specification.
## Feature Status
| Signal | API Status | SDK Status |
|---------|-------------|-------------------|
| Tracing | Stable | Release Candidate |
| Metrics | Development | Development |
| Logs | Roadmap | Roadmap |
| Signal | API Status | SDK Status |
| ------- | ----------- | ----------- |
| Tracing | Stable | Stable |
| Metrics | Stable | Stable |
| Logs | Development | Development |
For a more detailed breakdown of feature support see the [specification compliance matrix][compliance-matrix].
@ -172,72 +221,122 @@ For a more detailed breakdown of feature support see the [specification complian
We'd love your help!. Use tags [up-for-grabs][up-for-grabs-issues] and
[good first issue][good-first-issues] to get started with the project. For
instructions to build and make changes to this project, see the
[CONTRIBUTING](CONTRIBUTING.md) guide.
[CONTRIBUTING][CONTRIBUTING] guide.
We have a weekly SIG meeting! See the [community page](https://github.com/open-telemetry/community#javascript-sdk) for meeting details and notes.
Approvers ([@open-telemetry/js-approvers](https://github.com/orgs/open-telemetry/teams/javascript-approvers)):
### Maintainers
- [Chengzhong Wu](https://github.com/legendecas), Alibaba
- [Gerhard Stöbich](https://github.com/Flarna), Dynatrace
- [John Bley](https://github.com/johnbley), Splunk
- [Mark Wolff](https://github.com/markwolff), Microsoft
- [Matthew Wear](https://github.com/mwear), LightStep
- [Naseem K. Ullah](https://github.com/naseemkullah), Transit
- [Neville Wylie](https://github.com/MSNev), Microsoft
- [Olivier Albertini](https://github.com/OlivierAlbertini), Ville de Montréal
- [Rauno Viskus](https://github.com/Rauno56), Splunk
*Find more about the approver role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).*
Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers)):
- [Bartlomiej Obecny](https://github.com/obecny), LightStep
- [Amir Blum](https://github.com/blumamir), Odigos
- [Chengzhong Wu](https://github.com/legendecas), Bloomberg
- [Daniel Dyla](https://github.com/dyladan), Dynatrace
- [Valentin Marchaud](https://github.com/vmarchaud), Open Source Contributor
- [Jamie Danielson](https://github.com/JamieDanielson), Honeycomb
- [Marc Pichler](https://github.com/pichlermarc), Dynatrace
- [Trent Mick](https://github.com/trentm), Elastic
*Find more about the maintainer role in [community repository](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).*
For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
### Thanks to all the people who already contributed
### Approvers
- [David Luna](https://github.com/david-luna), Elastic
- [Hector Hernandez](https://github.com/hectorhdzg), Microsoft
- [Martin Kuba](https://github.com/martinkuba), Lightstep
- [Marylia Gutierrez](https://github.com/maryliag), Grafana Labs
- [Matthew Wear](https://github.com/mwear), LightStep
- [Neville Wylie](https://github.com/MSNev), Microsoft
- [Purvi Kanal](https://github.com/pkanal), Honeycomb
- [Svetlana Brennan](https://github.com/svetlanabrennan), New Relic
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
### Triagers
Members of this team have triager permissions for opentelemetry-js.git and opentelemetry-js-contrib.git.
- [Jackson Weber](https://github.com/JacksonWeber), Microsoft
For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
### Contrib Triagers
Members of this team have triager permissions for opentelemetry-js-contrib.git.
Typically, members of this are [component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml) of one or more packages in the contrib repo.
- [Aaron Abbott](https://github.com/aabmass), Google
- [Abhinav Mathur](https://github.com/abhee11), AppDynamics
- [Bartlomiej Obecny](https://github.com/obecny)
- [Daniel Li](https://github.com/d4nyll)
- [Florencia Acosta](https://github.com/facostaembrace), Embrace
- [Jackson Weber](https://github.com/JacksonWeber), Microsoft
- [Jaryk](https://github.com/Ugzuzg), Volvo Cars
- [Jonathan Lee](https://github.com/jj22ee)
- [Jonathan Munz](https://github.com/jpmunz), Embrace
- [kirrg001](https://github.com/kirrg001), Instana
- [MartenH](https://github.com/mhennoch), Splunk
- [Mike Goldsmith](https://github.com/MikeGoldsmith), Honeycomb
- [Motti](https://github.com/mottibec)
- [Punya Biswal](https://github.com/punya), Google
- [Siim Kallas](https://github.com/seemk), Splunk
- [t2t2](https://github.com/t2t2), Splunk
- [Trivikram Kamat](https://github.com/trivikr), AWS
For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
### Emeriti
- [Bartlomiej Obecny](https://github.com/obecny), Maintainer
- [Brandon Gonzalez](https://github.com/bg451), Approver
- [Daniel Khan](https://github.com/dkhan), Maintainer
- [Gerhard Stöbich](https://github.com/Flarna), Approver
- [Haddas Bronfman](https://github.com/haddasbronfman), Approver
- [John Bley](https://github.com/johnbley), Approver
- [Mark Wolff](https://github.com/markwolff), Approver
- [Mayur Kale](https://github.com/mayurkale22), Maintainer
- [Naseem K. Ullah](https://github.com/naseemkullah), Approver
- [Olivier Albertini](https://github.com/OlivierAlbertini), Approver
- [Rauno Viskus](https://github.com/rauno56), Maintainer
- [Roch Devost](https://github.com/rochdev), Approver
- [Valentin Marchaud](https://github.com/vmarchaud), Maintainer
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
### Thanks to all of our contributors!
<a href="https://github.com/open-telemetry/opentelemetry-js/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js" />
<img alt="Repo contributors" src="https://contrib.rocks/image?repo=open-telemetry/opentelemetry-js" />
</a>
### Thanks to all previous approvers and maintainers
- [Daniel Khan](https://github.com/dkhan), Dynatrace, Maintainer
- [Mayur Kale](https://github.com/mayurkale22), Google, Maintainer
- [Brandon Gonzalez](https://github.com/bg451), LightStep, Approver
- [Roch Devost](https://github.com/rochdev), DataDog, Approver
## Packages
### API
| Package | Description |
|----------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@opentelemetry/api][otel-api] | This package provides TypeScript interfaces, enums and no-op implementations for the OpenTelemetry core trace and metrics model. It is intended for use both on the server and in the browser. |
| [@opentelemetry/core][otel-core] | This package provides default and no-op implementations of the OpenTelemetry api for trace and metrics. It's intended for use both on the server and in the browser. |
### Implementation / SDKs
| Package | Description |
|----------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [@opentelemetry/sdk-trace-base][otel-tracing] | This module provides a full control over instrumentation and span creation. It doesn't load [`async_hooks`](https://nodejs.org/api/async_hooks.html) or any instrumentation by default. It is intended for use both on the server and in the browser. |
| [@opentelemetry/sdk-metrics-base][otel-metrics] | This module provides instruments and meters for reporting of time series data. |
| [@opentelemetry/sdk-trace-node][otel-node] | This module provides automatic tracing for Node.js applications. It is intended for use on the server only. |
| [@opentelemetry/sdk-trace-web][otel-web] | This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only. |
| Package | Description |
| --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@opentelemetry/sdk-trace-base][otel-tracing] | This module provides a full control over instrumentation and span creation. It doesn't load [`async_hooks`](https://nodejs.org/api/async_hooks.html) or any instrumentation by default. It is intended for use both on the server and in the browser. |
| [@opentelemetry/sdk-metrics][otel-metrics] | This module provides instruments and meters for reporting of time series data. |
| [@opentelemetry/sdk-trace-node][otel-node] | This module provides automatic tracing for Node.js applications. It is intended for use on the server only. |
| [@opentelemetry/sdk-trace-web][otel-web] | This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only. |
### Compatible Exporters
OpenTelemetry is vendor-agnostic and can upload data to any backend with various exporter implementations. Even though, OpenTelemetry provides support for many backends, vendors/users can also implement their own exporters for proprietary and unofficially supported backends.
See the [OpenTelemetry registry](https://opentelemetry.io/registry/?s=node.js) for a list of exporters available.
See the [OpenTelemetry registry](https://opentelemetry.io/registry/?language=js&component=exporter#) for a list of exporters available.
### Instrumentations
OpenTelemetry can collect tracing data automatically using instrumentations. Vendors/Users can also create and use their own. Currently, OpenTelemetry supports automatic tracing for:
OpenTelemetry can collect tracing data automatically using instrumentations.
To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, Vendor/Users can [write an instrumentation yourself](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md).
Currently, OpenTelemetry supports automatic tracing for:
#### Node Instrumentations
@ -248,17 +347,7 @@ OpenTelemetry can collect tracing data automatically using instrumentations. Ven
##### Contrib
These plugins are hosted at <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node>
- [@opentelemetry/instrumentation-mongodb][otel-contrib-instrumentation-mongodb]
- [@opentelemetry/instrumentation-mysql][otel-contrib-instrumentation-mysql]
- [@opentelemetry/instrumentation-pg][otel-contrib-instrumentation-pg]
- [@opentelemetry/instrumentation-redis][otel-contrib-instrumentation-redis]
- [@opentelemetry/instrumentation-ioredis][otel-contrib-instrumentation-ioredis]
- [@opentelemetry/instrumentation-express][otel-contrib-instrumentation-express]
- [@opentelemetry/instrumentation-dns][otel-contrib-instrumentation-dns]
- [@opentelemetry/instrumentation-hapi][otel-contrib-instrumentation-hapi]
- [@opentelemetry/instrumentation-koa][otel-contrib-instrumentation-koa]
These instrumentations are hosted at <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node>
#### Web Instrumentations
@ -271,199 +360,15 @@ These plugins are hosted at <https://github.com/open-telemetry/opentelemetry-js-
These instrumentations are hosted at <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web>
- [@opentelemetry/instrumentation-document-load][otel-contrib-instrumentation-document-load]
- [@opentelemetry/instrumentation-user-interaction][otel-contrib-instrumentation-user-interaction]
To request automatic tracing support for a module not on this list, please [file an issue](https://github.com/open-telemetry/opentelemetry-js/issues). Alternatively, you can [write an instrumentation yourself](https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/instrumentation-guide.md).
### Shims
| Package | Description |
|----------------------------------------------------------|-----------------------------------------------------------------------------------------|
| -------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [@opentelemetry/shim-opentracing][otel-shim-opentracing] | OpenTracing shim allows existing OpenTracing instrumentation to report to OpenTelemetry |
## Upgrade guidelines
### 0.24.x to x
- SDKs packages for trace and metrics has been renamed to have a consistent naming schema:
- @opentelemetry/tracing -> @opentelemetry/sdk-trace-base
- @opentelemetry/node -> @opentelemetry/sdk-trace-node
- @opentelemetry/web -> @opentelemetry/sdk-trace-web
- @opentelemetry/metrics -> @opentelemetry/sdk-metrics-base
- @opentelemetry/node-sdk -> @opentelemetry/sdk-node
### 0.23.x to 0.24.x
- `ResourceAttributes` renamed to `SemanticResourceAttributes` in the `@opentelemetry/semantic-conventions` package
### 0.19.x to 0.20.0
- `HttpBaggage` renamed to `HttpBaggagePropagator`
- `HttpTraceContext` renamed to `HttpTraceContextPropagator`
- `JaegerHttpTracePropagator` renamed to `JaegerPropagator`
- `serviceName` configuration removed from Collector exporters. Use `service.name` Resource attribute instead.
### 0.18.x to 0.19.0
- API is now a peer dependency. This means that users will need to include `@opentelemetry/api` as a dependency of their project in order to use the SDK. NPM version 7+ (Node 15+) should do this automatically.
- All plugins have been removed in favor of instrumentations.
- The `@opentelemetry/propagator-b3` package previously exported three propagators: `B3Propagator`,`B3SinglePropagator`, and `B3MultiPropagator`, but now only exports the `B3Propagator`. It extracts b3 context in single and multi-header encodings, and injects context using the single-header encoding by default, but can be configured to inject context using the multi-header endcoding during construction: `new B3Propagator({ injectEncoding: B3InjectEncoding.MULTI_HEADER })`. If you were previously using the `B3SinglePropagator` or `B3MultiPropagator` directly, you should update your code to use the `B3Propagator` with the appropriate configuration. See the [readme](./packages/opentelemetry-propagator-b3/readme.md) for full details and usage.
- Sampling configuration via environment variable has changed. If you were using `OTEL_SAMPLING_PROBABILITY` then you should replace it with `OTEL_TRACES_SAMPLER=parentbased_traceidratio` and `OTEL_TRACES_SAMPLER_ARG=<number>` where `<number>` is a number in the [0..1] range, e.g. "0.25". Default is 1.0 if unset.
### 0.17.0 to 0.18.0
- `diag.setLogLevel` is removed and LogLevel can be set by an optional second parameter to `setLogger`
[PR-1975](https://github.com/open-telemetry/opentelemetry-js/pull/1975)
- Breaking change - The resulting resource MUST have all attributes that are on any of the two input resources. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked - previously it was opposite.
### 0.16.0 to 0.17.0
[PR-1880](https://github.com/open-telemetry/opentelemetry-js/pull/1880) feat(diag-logger): introduce a new global level api.diag for internal diagnostic logging
[PR-1925](https://github.com/open-telemetry/opentelemetry-js/pull/1925) feat(diag-logger): part 2 - breaking changes - remove api.Logger, api.NoopLogger, core.LogLevel, core.ConsoleLogger
- These PR's remove the previous ```Logger``` and ```LogLevel``` implementations and change the way you should use the replacement ```DiagLogger``` and ```DiagLogLevel```, below are simple examples of how to change your existing usages.
#### Setting the global diagnostic logger
The new global [```api.diag```](https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-api/src/api/diag.ts#L32) provides the ability to set the global diagnostic logger ```setLogger()``` and logging level ```setLogLevel()```, it is also a ```DiagLogger``` implementation and should be directly to log diagnostic messages.
All included logger references have been removed in preference to using the global ```api.diag``` directly, so you no longer need to pass around the logger instance via function parameters or included as part of the configuration for a component.
```javascript
import { diag, DiagConsoleLogger, DiagLogLevel } from "@opentelemetry/api";
// Setting the default Global logger to use the Console
// And optionally change the logging level (Defaults to INFO)
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ERROR)
```
#### Using the logger anywhere in the code
```typescript
import { diag } from "@opentelemetry/api";
// Remove or make optional the parameter and don't use it.
export function MyFunction() {
diag.debug("...");
diag.info("...");
diag.warn("...");
diag.error("...");
diag.verbose("..");
}
```
#### Setting the logger back to a noop
```typescript
import { diag } from "@opentelemetry/api";
diag.setLogger();
```
[PR-1855](https://github.com/open-telemetry/opentelemetry-js/pull/1855) Use instrumentation loader to load plugins and instrumentations
- Providers do no load the plugins anymore. Also PluginLoader has been removed from providers, use `registerInstrumentations` instead
```javascript
//Previously in node
const provider = new NodeTracerProvider({
plugins: {
'@grpc/grpc-js': {
enabled: true,
path: '@opentelemetry/plugin-grpc-js',
},
}
});
// Now
const provider = new NodeTracerProvider();
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
registerInstrumentations({
instrumentations: [
{
plugins: {
'@grpc/grpc-js': {
enabled: true,
path: '@opentelemetry/plugin-grpc-js',
},
}
}
],
tracerProvider: provider,
});
// or if you want to load only default instrumentations / plugins
registerInstrumentations({
tracerProvider: provider,
});
//Previously in browser
const provider = new WebTracerProvider({
plugins: [
new DocumentLoad()
]
});
// Now
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const provider = new WebTracerProvider();
registerInstrumentations({
instrumentations: [
new DocumentLoad(),
],
});
```
- `registerInstrumentations` supports loading old plugins and instrumentations together. It also supports setting tracer provider and meter provider on instrumentations
[PR-1874](https://github.com/open-telemetry/opentelemetry-js/pull/1874) More specific API type names
Some types exported from `"@opentelemetry/api"` have been changed to be more specific.
- `AttributeValue` renamed to `SpanAttributeValue`
- `Attributes` renamed to `SpanAttributes`
- `EntryTtl` renamed to `BaggageEntryTtl`
- `EntryValue` renamed to `BaggageEntryValue`
- `Status` renamed to `SpanStatus`
- `StatusCode` renamed to `SpanStatusCode`
### 0.15.0 to 0.16.0
[PR-1863](https://github.com/open-telemetry/opentelemetry-js/pull/1863) removed public attributes `keepAlive` and `httpAgentOptions` from nodejs `CollectorTraceExporter` and `CollectorMetricExporter`
### 0.14.0 to 0.15.0
[PR-1764](https://github.com/open-telemetry/opentelemetry-js/pull/1764) removed some APIs from `Tracer`:
- `Tracer.getCurrentSpan()`: use `api.getSpan(api.context.active())`
- `Tracer.withSpan(span)`: use `api.context.with(api.setSpan(api.context.active(), span))`
- `Tracer.bind(target)`: use `api.context.bind(target)`
[PR-1797](https://github.com/open-telemetry/opentelemetry-js/pull/1797) chore!: split metrics into its own api package:
- Any references to `require("@opentelemetry/api").metrics` will need to be changed to `require("@opentelemetry/api-metrics").metrics`
[PR-1725](https://github.com/open-telemetry/opentelemetry-js/pull/1725) Use new gRPC default port
- The default port used by `@opentelemetry/exporter-collector-grpc` is changed from `55680` to `4317`
[PR-1749](https://github.com/open-telemetry/opentelemetry-js/pull/1749) chore: improve naming of span related context APIs
- Rename `[gs]etActiveSpan()` to `[gs]etSpan()`
- Rename `setExtractedSpanContext()` to `setSpanContext()`
- Rename `getParentSpanContext()` to `getSpanContext()`
## Useful links
- [Upgrade to SDK 2.x guide](./doc/upgrade-to-2.x.md)
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
@ -476,34 +381,24 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[up-for-grabs-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs
[good-first-issues]: https://github.com/open-telemetry/OpenTelemetry-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
[client-instrumentation-sig]: https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w/edit
[docs]: https://open-telemetry.github.io/opentelemetry-js
[compliance-matrix]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md
[CONTRIBUTING]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-metrics-base
[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/sdk-metrics
[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node
[otel-instrumentation-fetch]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-fetch
[otel-instrumentation-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-grpc
[otel-instrumentation-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-http
[otel-instrumentation-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-instrumentation-xml-http-request
[otel-instrumentation-fetch]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-fetch
[otel-instrumentation-grpc]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-grpc
[otel-instrumentation-http]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-http
[otel-instrumentation-xml-http-request]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-xml-http-request
[otel-shim-opentracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-shim-opentracing
[otel-tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base
[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web
[otel-api]: https://github.com/open-telemetry/opentelemetry-js-api
[otel-api]: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
[otel-core]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core
[generate-api-documentation]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md#generating-api-documentation
[otel-contrib-instrumentation-dns]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-dns
[otel-contrib-instrumentation-ioredis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-ioredis
[otel-contrib-instrumentation-mongodb]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-mongodb
[otel-contrib-instrumentation-mysql]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-mysql
[otel-contrib-instrumentation-pg]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-pg
[otel-contrib-instrumentation-redis]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-redis
[otel-contrib-instrumentation-express]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-express
[otel-contrib-instrumentation-user-interaction]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web/opentelemetry-instrumentation-user-interaction
[otel-contrib-instrumentation-document-load]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/web/opentelemetry-instrumentation-document-load
[otel-contrib-instrumentation-hapi]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-hapi
[otel-contrib-instrumentation-koa]: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/master/plugins/node/opentelemetry-instrumentation-koa
[spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md

View File

@ -1,123 +0,0 @@
# Releasing OpenTelemetry Packages
This document explains how to publish all OT modules at version x.y.z. Ensure that youre following semver when choosing a version number.
Release Process:
- [Release Process (Maintainers only)](#release-process)
- [Update to latest locally](#update-to-latest-locally)
- [Create a new branch](#create-a-new-branch)
- [Prepare each package for release](#prepare-each-package-for-release)
- [Use the Changelog to create a GitHub Release](#use-the-changelog-to-create-a-github-release)
- [Generate the changelog with lerna](#generate-the-changelog-with-lerna)
- [How to use](#how-to-use)
- [Update Changelog file](#update-changelog-file)
- [Create a new PR](#create-a-new-pr)
- [Merge and pull](#merge-and-pull)
- [Publish all packages](#publish-all-packages)
- [Publish the GitHub Release](#publish-the-github-release)
- [Update CHANGELOG](#update-changelog)
- [Known Issues](#known-issues)
## Release Process
### Update to latest locally
Use `git fetch` and `git checkout origin/main` to ensure youre on the latest commit. Make sure you have no unstaged changes. Ideally, also use `git clean -dfx` to remove all ignored and untracked files.
### Create a new branch
Create a new branch called `x.y.z-proposal` from the current commit.
### Prepare each package for release
Decide on the next `major.minor.patch` release number based on [semver](http://semver.org/) guidelines.
- Use `npm install` command to initialize all package directories
- Use `lerna publish --skip-npm --no-git-tag-version --no-push` to bump the version in all `package.json`
- Use `npm run bootstrap` to generate latest `version.ts` files
### Use the Changelog to create a GitHub Release
#### Generate the changelog with lerna
Since we use `lerna`, we can use [lerna-changelog](https://github.com/lerna/lerna-changelog#lerna-changelog)
##### How to use
Pass your [github token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) to generate the changelog automatically.
For security reasons, when you create a Github token, select the permissions: under **repo**, select **Access public repositories**, **Access commit status**.
In your terminal, execute the following command:
```bash
GITHUB_AUTH=<your token> lerna-changelog
```
It will print something like:
```md
### Unreleased (2018-05-24)
##### :bug: Bug Fix
* [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))
##### :house: Internal
* [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))
##### Commiters: 2
- Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
- [@careful-coder](https://github.com/careful-coder)
```
By default lerna-changelog will show all pull requests that have been merged since the latest tagged commit in the repository. That is however only true for pull requests **with certain labels applied** (see [lerna.json](lerna.json) for authorized labels).
You can also use the `--from` and `--to` options to view a different range of pull requests:
```sh
GITHUB_AUTH=xxxxx lerna-changelog --from=v1.0.0 --to=v2.0.0
```
##### Update Changelog file
From what `lerna-changelog` has generated, starts new Unreleased label. Follow the example set by recent Released label.
On [GitHub Releases](https://github.com/open-telemetry/opentelemetry-js/releases), follow the example set by recent releases to populate a summary of changes, as well as a list of commits that were applied since the last release. Save it as a draft, dont publish it. Dont forget the tag -- call it `vx.y.z` and leave it pointing at `main` for now (this can be changed as long as the GitHub release isnt published).
### Create a new PR
Create a pull request titled `chore: x.y.z release proposal`. The commit body should just be a link to the draft notes. Someone who can access draft notes should approve it, looking in particular for test passing, and whether the draft notes are satisfactory.
### Merge and pull
Merge the PR, and pull the changes locally (using the commands in the first step). Ensure that `chore: x.y.z release proposal` is the most recent commit.
### Publish all packages
Go into each directory and use `npm publish` (requires permissions) to publish the package. You can use the following script to automate this.
```bash
#!/bin/bash
for dir in $(ls packages); do
pushd packages/$dir
npm publish
popd
done
```
Check your e-mail and make sure the number of “youve published this module” emails matches the number you expect.
### Publish the GitHub Release
Publish the GitHub release, ensuring that the tag points to the newly landed commit corresponding to release proposal `x.y.z`.
### Update CHANGELOG
- After releasing is done, update the [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-js/blob/main/CHANGELOG.md) and start new Unreleased label.
- Create a new commit with the exact title: `Post Release: update CHANGELOG.md`.
- Go through PR review and merge it to GitHub main branch.
### Known Issues
- The `examples/` and `getting-started/` folders are not part of lerna packages, we need to manually bump the version in `package.json`.

View File

@ -4,5 +4,5 @@ module.exports = {
"commonjs": true,
"shared-node-browser": true
},
...require('../../eslint.config.js')
...require('../eslint.base.js')
}

295
api/CHANGELOG.md Normal file
View File

@ -0,0 +1,295 @@
<!-- markdownlint-disable MD004 -->
# CHANGELOG
All notable changes to this project will be documented in this file.
## Unreleased
### :boom: Breaking Change
### :rocket: (Enhancement)
* feat(api): improve isValidSpanId, isValidTraceId performance [#5714](https://github.com/open-telemetry/opentelemetry-js/pull/5714) @seemk
* feat(diag): change types in `DiagComponentLogger` from `any` to `unknown`[#5478](https://github.com/open-telemetry/opentelemetry-js/pull/5478) @loganrosen
### :bug: (Bug Fix)
### :books: (Refine Doc)
### :house: (Internal)
* refactor(api): remove "export *" in favor of explicit named exports [#4880](https://github.com/open-telemetry/opentelemetry-js/pull/4880) @robbkidd
* chore: enable tsconfig isolatedModules [#5697](https://github.com/open-telemetry/opentelemetry-js/pull/5697) @legendecas
## 1.9.0
### :rocket: (Enhancement)
* feat(metrics): added synchronous gauge [#4528](https://github.com/open-telemetry/opentelemetry-js/pull/4528) @clintonb
* feat(api): allow adding span links after span creation [#4536](https://github.com/open-telemetry/opentelemetry-js/pull/4536) @seemk
* This change is non-breaking for end-users, but breaking for Trace SDK implmentations in accordance with the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122) as new features need to be implemented.
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
## 1.8.0
### :rocket: (Enhancement)
* feat(api): add SugaredTracer for functions not defined in the spec
### :bug: (Bug Fix)
* fix(api): fix unreachable @opentelemetry/api/experimental entry [#4446](https://github.com/open-telemetry/opentelemetry-js/pull/4446) @legendecas
## 1.7.0
### :rocket: (Enhancement)
* feat(metrics): prototype experimental advice support [#3876](https://github.com/open-telemetry/opentelemetry-js/pull/3876) @legendecas
* feat(api): publish api esnext target [#4231](https://github.com/open-telemetry/opentelemetry-js/pull/4231) @legendecas
## 1.6.0
### :bug: (Bug Fix)
* Revert "feat(api): add attributes argument to recordException API [#4071](https://github.com/open-telemetry/opentelemetry-js/pull/4071)"
* This feature was an unintentional breaking change introduced with 1.5.0
## 1.5.0
### :rocket: (Enhancement)
* feat(api): add attributes argument to recordException API [#4071](https://github.com/open-telemetry/opentelemetry-js/pull/4071)
## 1.4.1
### :bug: (Bug Fix)
* fix(metrics): export `MetricsAPI` type [#3535](https://github.com/open-telemetry/opentelemetry-js/pull/3535)
* fix(api): rename `LoggerOptions` to `DiagLoggerOptions` [#3641](https://github.com/open-telemetry/opentelemetry-js/pull/3641)
* fix(api): export `DiagLoggerOptions` type [#3639](https://github.com/open-telemetry/opentelemetry-js/pull/3639)
## 1.4.0
### :rocket: (Enhancement)
* feat(api): add `getActiveBaggage` API [#3385](https://github.com/open-telemetry/opentelemetry-js/pull/3385)
* feat(api): add optional `droppedAttributesCount` property in the `Link` interface [#3576](https://github.com/open-telemetry/opentelemetry-js/pull/3576) @mohitk05
### :bug: (Bug Fix)
* fix(api): deprecate MetricAttributes and MetricAttributeValue [#3406](https://github.com/open-telemetry/opentelemetry-js/pull/3406) @blumamir
* fix(api): use active context as default in NoopTracer [#3476](https://github.com/open-telemetry/opentelemetry-js/pull/3476) @flarna
* fix(api): declare this parameter type in observable callbacks [#3497](https://github.com/open-telemetry/opentelemetry-js/pull/3497) @legendecas
### :house: (Internal)
* test(api): disable module concatenation in tree-shaking test [#3409](https://github.com/open-telemetry/opentelemetry-js/pull/3409) @legendecas
## [1.3.0](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.2.0...v1.3.0)
* feat(api): merge api-metrics into api [#3374](https://github.com/open-telemetry/opentelemetry-js/pull/3374) @legendecas
* Optionally suppress warning about logger being overwritten ([#3366](https://www.github.com/open-telemetry/opentelemetry-js-api/pull/3366))
## [1.2.0](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.1.0...v1.2.0) (2022-08-09)
### Features
* Add getActiveSpan to trace API ([#163](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/163)) ([17ccb3a](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/17ccb3a4e385bc5769ded6fc742c9782a93244a5))
* deprecate Sampler ([#166](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/166)) ([313b2e2](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/313b2e2225f246a6a9518ec4da6942f7d61babce))
## [1.1.0](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.4...v1.1.0) (2022-01-25)
### Features
* add tracestate implementation to api ([#147](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/147)) ([82842c7](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/82842c7097614e6ece99e73838ac5e94ff5460b7))
* define common attributes type ([#142](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/142)) ([ae9bead](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/ae9bead17750d35dec4b63cfae098087666abc85))
* **trace:** add optional schema url to TracerProvider.getTracer ([#129](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/129)) ([aa65fc6](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/aa65fc66809d45090d6e4951c265386d17ccc6f6))
### Bug Fixes
* export tracer options ([#154](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/154)) ([b125324](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/b125324438fb2f24eb80c7c6673afc8cfc99575e))
## [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
### Bug Fixes
* align globalThis fallbacks with otel-core ([#126](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/126)) ([3507de7](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/3507de7c3b95396696657c021953b0b24a63a029))
## [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30)
### Bug Fixes
* remove all circular dependencies ([#119](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/119)) ([a8083e8](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/a8083e84b23227828745da80fd5fe512357dd34b))
## 1.0.2
### :bug: Bug Fix
* [#105](https://github.com/open-telemetry/opentelemetry-js-api/pull/105) fix: set delegate after successful registration ([@Flarna](https://github.com/Flarna))
* [#94](https://github.com/open-telemetry/opentelemetry-js-api/pull/94) fix: enforce strict equality on prerelease versions ([@dyladan](https://github.com/dyladan))
### :memo: Documentation
* [#106](https://github.com/open-telemetry/opentelemetry-js-api/pull/106) docs: fix crash in README example ([@trentm](https://github.com/trentm))
* [#101](https://github.com/open-telemetry/opentelemetry-js-api/pull/101) docs: Format example for tracer.startActiveSpan ([@ad-m](https://github.com/ad-m))
* [#99](https://github.com/open-telemetry/opentelemetry-js-api/pull/99) chore: fix link to API docs ([@dyladan](https://github.com/dyladan))
### :house: Internal
* [#109](https://github.com/open-telemetry/opentelemetry-js-api/pull/109) internal: add missing approvers from core ([@dyladan](https://github.com/dyladan))
* [#103](https://github.com/open-telemetry/opentelemetry-js-api/pull/103) chore: reuse NoopTracer in ProxyTracer ([@Flarna](https://github.com/Flarna))
### Committers: 4
* Adam Dobrawy ([@ad-m](https://github.com/ad-m))
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
* Trent Mick ([@trentm](https://github.com/trentm))
## 1.0.1
### :bug: Bug Fix
* [#96](https://github.com/open-telemetry/opentelemetry-js-api/pull/96) chore: remove circular dependency ([@dyladan](https://github.com/dyladan))
### Committers: 1
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
## 1.0.0
### :memo: Documentation
* [#89](https://github.com/open-telemetry/opentelemetry-js-api/pull/89) chore: update upgrade guidelines ([@dyladan](https://github.com/dyladan))
### :house: Internal
* [#90](https://github.com/open-telemetry/opentelemetry-js-api/pull/90) chore: enable typescript 4.3 noImplicitOverride option ([@Flarna](https://github.com/Flarna))
### Committers: 2
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
## 0.21.0
### :boom: Breaking Change
* [#78](https://github.com/open-telemetry/opentelemetry-js-api/pull/78) feat: unify signatures of `with` and `bind` ([@Rauno56](https://github.com/Rauno56))
* [#46](https://github.com/open-telemetry/opentelemetry-js-api/pull/46) chore: do not export singletons ([@dyladan](https://github.com/dyladan))
### :rocket: Enhancement
* [#81](https://github.com/open-telemetry/opentelemetry-js-api/pull/81) chore: function overloads implementation of startActiveSpan in noop t… ([@naseemkullah](https://github.com/naseemkullah))
### :house: Internal
* [#84](https://github.com/open-telemetry/opentelemetry-js-api/pull/84) chore: remove unused backwards compatibility folder ([@Flarna](https://github.com/Flarna))
* [#85](https://github.com/open-telemetry/opentelemetry-js-api/pull/85) chore: add node:16 to the test matrix ([@Rauno56](https://github.com/Rauno56))
* [#63](https://github.com/open-telemetry/opentelemetry-js-api/pull/63) feat: debug log global registrations and logger overwrites ([@Rauno56](https://github.com/Rauno56))
* [#75](https://github.com/open-telemetry/opentelemetry-js-api/pull/75) Add CodeQL Security Scan ([@xukaren](https://github.com/xukaren))
* [#79](https://github.com/open-telemetry/opentelemetry-js-api/pull/79) chore: fix eslint config ([@Rauno56](https://github.com/Rauno56))
### Committers: 5
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
* Karen Xu ([@xukaren](https://github.com/xukaren))
* Naseem ([@naseemkullah](https://github.com/naseemkullah))
* Rauno Viskus ([@Rauno56](https://github.com/Rauno56))
## 0.20.0
### :rocket: Enhancement
* [#69](https://github.com/open-telemetry/opentelemetry-js-api/pull/69) feat(context): add utils method to remove keys from context ([@vmarchaud](https://github.com/vmarchaud))
* [#71](https://github.com/open-telemetry/opentelemetry-js-api/pull/71) chore: export baggage ([@dyladan](https://github.com/dyladan))
### Committers: 2
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Valentin Marchaud ([@vmarchaud](https://github.com/vmarchaud))
## 0.19.0
### :boom: Breaking Change
* [#55](https://github.com/open-telemetry/opentelemetry-js-api/pull/55) chore: move baggage methods in propagation namespace ([@vmarchaud](https://github.com/vmarchaud))
* [#65](https://github.com/open-telemetry/opentelemetry-js-api/pull/65) chore: remove suppress instrumentation ([@dyladan](https://github.com/dyladan))
* [#60](https://github.com/open-telemetry/opentelemetry-js-api/pull/60) chore: removing timed event ([@obecny](https://github.com/obecny))
* [#58](https://github.com/open-telemetry/opentelemetry-js-api/pull/58) chore: use spancontext for link ([@dyladan](https://github.com/dyladan))
* [#47](https://github.com/open-telemetry/opentelemetry-js-api/pull/47) chore: move span method for context in trace API #40 ([@vmarchaud](https://github.com/vmarchaud))
* [#45](https://github.com/open-telemetry/opentelemetry-js-api/pull/45) chore: rename `span#context()` to `span#spanContext` ([@dyladan](https://github.com/dyladan))
* [#43](https://github.com/open-telemetry/opentelemetry-js-api/pull/43) chore: renaming noop span to non recording span ([@obecny](https://github.com/obecny))
* [#32](https://github.com/open-telemetry/opentelemetry-js-api/pull/32) feat!: return boolean success value from setGlobalXXX methods ([@dyladan](https://github.com/dyladan))
### :rocket: Enhancement
* [#62](https://github.com/open-telemetry/opentelemetry-js-api/pull/62) chore: adding component logger ([@obecny](https://github.com/obecny))
* [#54](https://github.com/open-telemetry/opentelemetry-js-api/pull/54) feat: add tracer.startActiveSpan() ([@naseemkullah](https://github.com/naseemkullah))
* [#58](https://github.com/open-telemetry/opentelemetry-js-api/pull/58) chore: use spancontext for link ([@dyladan](https://github.com/dyladan))
* [#51](https://github.com/open-telemetry/opentelemetry-js-api/pull/51) feat: add function to wrap SpanContext in NonRecordingSpan #49 ([@dyladan](https://github.com/dyladan))
### :memo: Documentation
* [#64](https://github.com/open-telemetry/opentelemetry-js-api/pull/64) chore: document the reason for symbol.for ([@dyladan](https://github.com/dyladan))
* [#44](https://github.com/open-telemetry/opentelemetry-js-api/pull/44) chore: updating readme headline and fixing links ([@obecny](https://github.com/obecny))
### Committers: 6
* Bartlomiej Obecny ([@obecny](https://github.com/obecny))
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
* Naseem ([@naseemkullah](https://github.com/naseemkullah))
* Valentin Marchaud ([@vmarchaud](https://github.com/vmarchaud))
* t2t2 ([@t2t2](https://github.com/t2t2))
## 1.0.0-rc.0
### :memo: Documentation
* [#20](https://github.com/open-telemetry/opentelemetry-js-api/pull/20) docs: document latest manual tracing ([@dyladan](https://github.com/dyladan))
* [#18](https://github.com/open-telemetry/opentelemetry-js-api/pull/18) chore: deploy docs on a release ([@dyladan](https://github.com/dyladan))
* [#19](https://github.com/open-telemetry/opentelemetry-js-api/pull/19) docs: fix readme links ([@dyladan](https://github.com/dyladan))
### Committers: 1
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
## 0.18.1
### :bug: Bug Fix
* [#16](https://github.com/open-telemetry/opentelemetry-js-api/pull/16) fix: Reverse the direction of the semver check ([@dyladan](https://github.com/dyladan))
### Committers: 1
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
## v0.18.0
### :boom: Breaking Change
* [#9](https://github.com/open-telemetry/opentelemetry-js-api/pull/9) chore: refactor diag logger ([@dyladan](https://github.com/dyladan))
### :rocket: Enhancement
* [#10](https://github.com/open-telemetry/opentelemetry-js-api/pull/10) Use semver to determine API compatibility ([@dyladan](https://github.com/dyladan))
### :house: Internal
* [#12](https://github.com/open-telemetry/opentelemetry-js-api/pull/12) chore: don't disable rule eqeqeq ([@Flarna](https://github.com/Flarna))
* [#8](https://github.com/open-telemetry/opentelemetry-js-api/pull/8) chore: remove nycrc in favor of tsconfig reporting ([@dyladan](https://github.com/dyladan))
* [#3](https://github.com/open-telemetry/opentelemetry-js-api/pull/3) chore: add test workflow ([@dyladan](https://github.com/dyladan))
* [#4](https://github.com/open-telemetry/opentelemetry-js-api/pull/4) chore: remove package lock ([@dyladan](https://github.com/dyladan))
* [#2](https://github.com/open-telemetry/opentelemetry-js-api/pull/2) chore: add lint workflow ([@dyladan](https://github.com/dyladan))
### Committers: 2
* Daniel Dyla ([@dyladan](https://github.com/dyladan))
* Gerhard Stöbich ([@Flarna](https://github.com/Flarna))
## v0.17.0
Versions previous to `0.18.0` were developed in another repository.
To see previous changelog entries see the [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-js/blob/main/CHANGELOG.md).

117
api/README.md Normal file
View File

@ -0,0 +1,117 @@
# OpenTelemetry API for JavaScript
<p align="center">
<strong>
<a href="https://open-telemetry.github.io/opentelemetry-js/modules/_opentelemetry_api.html">API Reference</a>
&nbsp;&nbsp;&bull;&nbsp;&nbsp;
<a href="https://opentelemetry.io/docs/instrumentation/js/">Documentation</a>
</br>
<a href="https://github.com/open-telemetry/opentelemetry-js/releases">
<img alt="NPM Release" src="https://img.shields.io/npm/v/@opentelemetry/api?color=brightgreen&logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAACQAAAAAQAAAJAAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAABigAwAEAAAAAQAAABgAAAAA8A2UOAAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAABK5JREFUSA2dVm1sFEUYfmd2b%2Ff2Pkqghn5eEQWKrRgjpkYgpoRCLC0oxV5apAiGUDEpJvwxEQ2raWPU%2BKf8INU%2FRtEedwTCR9tYPloxGNJYTTQUwYqJ1aNpaLH3sXu3t7vjvFevpSqt7eSyM%2B%2FczvM8877PzB3APBoLgoDLsNePF56LBwqa07EKlDGg84CcWsI4CEbhNnDpAd951lXE2NkiNknCCTLv4HtzZuvPm1C%2FIKv4oDNXqNDHragety2XVzjECZsJARuBMyRzJrh1O0gQwLXuxofxsPSj4hG8fMLQo7bl9JJD8XZfC1E5yWFOMtd07dvX5kDwg6%2B2%2B%2BChq8txHGtfPoAp0gOFmhYoNFkHjn2TNUmrwRdna7W1QSkU8hvbGk4uThLrapaiLA2E6QY4u%2FlS9ItHfvJkxYsTMVtnAJLipYIWtVrcdX%2B8%2Bb8IVnPl%2FR81prbuPZ1jpYw%2B0aEUGSkdFsgyBIaFTXCm6nyaxMtJ4n%2BTeDhJzGqZtQZcuYDgqDwDbqb0JF9oRpIG1Oea3bC1Y6N3x%2FWV8Zh83emhCs%2B%2BhlaghDw%2B8w5UlYKq2lU7Pl8IkvS9KDqXmKmEwdMppVPKwGSEilmyAwJhRwWcq7wYC6z4wZ1rrEoMWxecdOjZWXeAQClBcYDN3NwVwD9pGwqUSyQgclcmxpNJqCuwLmDh3WtvPqXdlt%2B6Oz70HPGDNSNBee%2FEOen%2BrGbEFqDENBPDbtdCp0ukPANmzO0QQJYUpyS5IJJI3Hqt4maS%2BEB3199ozm8EDU%2F6fVNU2dQpdx3ZnKzeFXyaUTiasEV%2FgZMzJMjr3Z%2BWvAdQ%2Bhs%2Fzw9savimxUntDSaBdZ2f%2BIdbm1rlNY8esFffBit9HtK5%2FMejsrJVxikOXlb1Ukir2X%2BRbdkd1KG2Ixfn2Ql4JRmELnYK9mEM8G36fAA3xEQ89fxXihC8q%2BsAKi9jhHxNqagY2hiaYgRCm0f0QP7H4Fp11LSXiuBY2aYFlh0DeDIVVFUJQn5rCnpiNI2gvLxHnASn9DIVHJJlm5rXvQAGEo4zvKq2w5G1NxENN7jrft1oxMdekETjxdH2Z3x%2BVTVYsPb%2BO0C%2F9%2FauN6v2hNZw5b2UOmSbG5%2FrkC3LBA%2B1PdxFxORjxpQ81GcxKc%2BybVjEBvUJvaGJ7p7n5A5KSwe4AzkasA%2BcrmzFtowoIVTiLjANm8GDsrWW35ScI3JY8Urv83tnkF8JR0yLvEt2hO%2F0qNyy3Jb3YKeHeHeLeOuVLRpNF%2Bpkf85OW7%2FzJxWdXsbsKBUk2TC0BCPwMq5Q%2FCPvaJFkNS%2F1l1qUPe%2BuH3oD59erYGI%2FY4sce6KaXYElAIOLt%2B0O3t2%2B%2FxJDF1XvOlWGC1W1B8VMszbGfOvT5qaRRAIFK3BCO164nZ0uYLH2YjNN8thXS2v2BK9gTfD7jHVxzHr4roOlEvYYz9QIz%2BVl%2FsLDXInsctFsXjqIRnO2ZO387lxmIboLDZCJ59KLFliNIgh9ipt6tLg9SihpRPDO1ia5byw7de1aCQmF5geOQtK509rzfdwxaKOIq%2B73AvwCC5%2F5fcV4vo3%2B3LpMdtWHh0ywsJC%2FZGoCb8%2F9D8F%2FifgLLl8S8QWfU8cAAAAASUVORK5CYII%3D">
</a>
</strong>
</p>
This package provides everything needed to interact with the OpenTelemetry API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.
The methods in this package perform no operations by default. This means they can be safely called by a library or end-user application whether there is an SDK registered or not. In order to generate and export telemetry data, you will also need an SDK such as the [OpenTelemetry JS SDK][opentelemetry-js].
## Tracing Quick Start
### You Will Need
- An application you wish to instrument
- [OpenTelemetry JS SDK][opentelemetry-js]
- Node.js >=8.5.0 (14+ is preferred) or an ECMAScript 5+ compatible browser
**Note:** ECMAScript 5+ compatibility is for this package only. Please refer to the documentation for the SDK you are using to determine its minimum ECMAScript version.
**Note for library authors:** Only your end users will need an OpenTelemetry SDK. If you wish to support OpenTelemetry in your library, you only need to use the OpenTelemetry API. For more information, please read the [tracing documentation][docs-tracing].
### Install Dependencies
```sh
npm install @opentelemetry/api @opentelemetry/sdk-trace-base
```
### Trace Your Application
In order to get started with tracing, you will need to first register an SDK. The SDK you are using may provide a convenience method which calls the registration methods for you, but if you would like to call them directly they are documented here: [SDK registration methods][docs-sdk-registration].
Once you have registered an SDK, you can start and end spans. A simple example of basic SDK registration and tracing a simple operation is below. The example should export spans to the console once per second. For more information, see the [tracing documentation][docs-tracing].
```javascript
const { trace } = require("@opentelemetry/api");
const { BasicTracerProvider, ConsoleSpanExporter, SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-base");
// Create and register an SDK
const provider = new BasicTracerProvider({
spanProcessors: [new SimpleSpanProcessor(new ConsoleSpanExporter())]
});
trace.setGlobalTracerProvider(provider);
// Acquire a tracer from the global tracer provider which will be used to trace the application
const name = 'my-application-name';
const version = '0.1.0';
const tracer = trace.getTracer(name, version);
// Trace your application by creating spans
async function operation() {
const span = tracer.startSpan("do operation");
// mock some work by sleeping 1 second
await new Promise((resolve, reject) => {
setTimeout(resolve, 1000);
})
span.end();
}
async function main() {
while (true) {
await operation();
}
}
main();
```
## Version Compatibility
Because the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same `node_modules` structure, the OpenTelemetry API takes advantage of a variable on the `global` object to store the global API. When an API method in the API package is called, it checks if this `global` API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.
## Upgrade Guidelines
### 0.21.0 to 1.0.0
No breaking changes
### 0.20.0 to 0.21.0
- [#78](https://github.com/open-telemetry/opentelemetry-js-api/issues/78) `api.context.bind` arguments reversed and `context` is now a required argument.
- [#46](https://github.com/open-telemetry/opentelemetry-js-api/issues/46) Noop classes and singletons are no longer exported. To create a noop span it is recommended to use `api.trace.wrapSpanContext` with `INVALID_SPAN_CONTEXT` instead of using the `NOOP_TRACER`.
### 1.0.0-rc.3 to 0.20.0
- Removing `TimedEvent` which was not part of spec
- `HttpBaggage` renamed to `HttpBaggagePropagator`
- [#45](https://github.com/open-telemetry/opentelemetry-js-api/pull/45) `Span#context` renamed to `Span#spanContext`
- [#47](https://github.com/open-telemetry/opentelemetry-js-api/pull/47) `getSpan`/`setSpan`/`getSpanContext`/`setSpanContext` moved to `trace` namespace
- [#55](https://github.com/open-telemetry/opentelemetry-js-api/pull/55) `getBaggage`/`setBaggage`/`createBaggage` moved to `propagation` namespace
## Useful links
- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
## License
Apache 2.0 - See [LICENSE][license-url] for more information.
[opentelemetry-js]: https://github.com/open-telemetry/opentelemetry-js
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md

24
api/karma.conf.js Normal file
View File

@ -0,0 +1,24 @@
/*!
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const karmaWebpackConfig = require('../karma.webpack');
const karmaBaseConfig = require('../karma.base');
module.exports = (config) => {
config.set(Object.assign({}, karmaBaseConfig, {
webpack: karmaWebpackConfig,
}))
};

24
api/karma.worker.js Normal file
View File

@ -0,0 +1,24 @@
/*!
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const karmaWebpackConfig = require('../karma.webpack');
const karmaBaseConfig = require('../karma.worker');
module.exports = (config) => {
config.set(Object.assign({}, karmaBaseConfig, {
webpack: karmaWebpackConfig,
}))
};

103
api/package.json Normal file
View File

@ -0,0 +1,103 @@
{
"name": "@opentelemetry/api",
"version": "1.9.0",
"description": "Public API for OpenTelemetry",
"main": "build/src/index.js",
"module": "build/esm/index.js",
"esnext": "build/esnext/index.js",
"types": "build/src/index.d.ts",
"browser": {
"./src/platform/index.ts": "./src/platform/browser/index.ts",
"./build/esm/platform/index.js": "./build/esm/platform/browser/index.js",
"./build/esnext/platform/index.js": "./build/esnext/platform/browser/index.js",
"./build/src/platform/index.js": "./build/src/platform/browser/index.js"
},
"exports": {
".": {
"module": "./build/esm/index.js",
"esnext": "./build/esnext/index.js",
"types": "./build/src/index.d.ts",
"default": "./build/src/index.js"
},
"./experimental": {
"module": "./build/esm/experimental/index.js",
"esnext": "./build/esnext/experimental/index.js",
"types": "./build/src/experimental/index.d.ts",
"default": "./build/src/experimental/index.js"
}
},
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"lint:fix": "eslint . --ext .ts --fix",
"lint": "eslint . --ext .ts",
"test:browser": "karma start --single-run",
"test": "nyc mocha 'test/**/*.test.ts'",
"test:webworker": "karma start karma.worker.js --single-run",
"cycle-check": "dpdm --exit-code circular:1 src/index.ts",
"version": "node ../scripts/version-update.js",
"prewatch": "npm run precompile",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"peer-api-check": "node ../scripts/peer-api-check.js"
},
"keywords": [
"opentelemetry",
"nodejs",
"browser",
"tracing",
"profiling",
"stats",
"monitoring"
],
"author": "OpenTelemetry Authors",
"license": "Apache-2.0",
"engines": {
"node": ">=8.0.0"
},
"files": [
"build/esm/**/*.js",
"build/esm/**/*.js.map",
"build/esm/**/*.d.ts",
"build/esnext/**/*.js",
"build/esnext/**/*.js.map",
"build/esnext/**/*.d.ts",
"build/src/**/*.js",
"build/src/**/*.js.map",
"build/src/**/*.d.ts",
"LICENSE",
"README.md"
],
"publishConfig": {
"access": "public"
},
"devDependencies": {
"@types/mocha": "10.0.10",
"@types/node": "^8.10.66",
"@types/sinon": "17.0.4",
"@types/webpack": "5.28.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "7.0.0",
"cross-var": "1.1.0",
"dpdm": "3.13.1",
"karma": "6.4.4",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.2.1",
"karma-mocha": "2.0.1",
"karma-mocha-webworker": "1.3.0",
"karma-spec-reporter": "0.0.36",
"karma-webpack": "5.0.1",
"lerna": "6.6.2",
"memfs": "3.5.3",
"mocha": "11.1.0",
"nyc": "17.1.0",
"sinon": "18.0.1",
"ts-loader": "9.5.2",
"typescript": "5.0.4",
"unionfs": "4.5.4",
"webpack": "5.99.9"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api",
"sideEffects": false
}

101
api/src/api/context.ts Normal file
View File

@ -0,0 +1,101 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NoopContextManager } from '../context/NoopContextManager';
import { Context, ContextManager } from '../context/types';
import {
getGlobal,
registerGlobal,
unregisterGlobal,
} from '../internal/global-utils';
import { DiagAPI } from './diag';
const API_NAME = 'context';
const NOOP_CONTEXT_MANAGER = new NoopContextManager();
/**
* Singleton object which represents the entry point to the OpenTelemetry Context API
*
* @since 1.0.0
*/
export class ContextAPI {
private static _instance?: ContextAPI;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor() {}
/** Get the singleton instance of the Context API */
public static getInstance(): ContextAPI {
if (!this._instance) {
this._instance = new ContextAPI();
}
return this._instance;
}
/**
* Set the current context manager.
*
* @returns true if the context manager was successfully registered, else false
*/
public setGlobalContextManager(contextManager: ContextManager): boolean {
return registerGlobal(API_NAME, contextManager, DiagAPI.instance());
}
/**
* Get the currently active context
*/
public active(): Context {
return this._getContextManager().active();
}
/**
* Execute a function with an active context
*
* @param context context to be active during function execution
* @param fn function to execute in a context
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
*/
public with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(
context: Context,
fn: F,
thisArg?: ThisParameterType<F>,
...args: A
): ReturnType<F> {
return this._getContextManager().with(context, fn, thisArg, ...args);
}
/**
* Bind a context to a target function or event emitter
*
* @param context context to bind to the event emitter or function. Defaults to the currently active context
* @param target function or event emitter to bind
*/
public bind<T>(context: Context, target: T): T {
return this._getContextManager().bind(context, target);
}
private _getContextManager(): ContextManager {
return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;
}
/** Disable and remove the global context manager */
public disable() {
this._getContextManager().disable();
unregisterGlobal(API_NAME, DiagAPI.instance());
}
}

145
api/src/api/diag.ts Normal file
View File

@ -0,0 +1,145 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DiagComponentLogger } from '../diag/ComponentLogger';
import { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';
import {
ComponentLoggerOptions,
DiagLogFunction,
DiagLogger,
DiagLoggerApi,
DiagLogLevel,
} from '../diag/types';
import {
getGlobal,
registerGlobal,
unregisterGlobal,
} from '../internal/global-utils';
const API_NAME = 'diag';
/**
* Singleton object which represents the entry point to the OpenTelemetry internal
* diagnostic API
*
* @since 1.0.0
*/
export class DiagAPI implements DiagLogger, DiagLoggerApi {
private static _instance?: DiagAPI;
/** Get the singleton instance of the DiagAPI API */
public static instance(): DiagAPI {
if (!this._instance) {
this._instance = new DiagAPI();
}
return this._instance;
}
/**
* Private internal constructor
* @private
*/
private constructor() {
function _logProxy(funcName: keyof DiagLogger): DiagLogFunction {
return function (...args) {
const logger = getGlobal('diag');
// shortcut if logger not set
if (!logger) return;
return logger[funcName](...args);
};
}
// Using self local variable for minification purposes as 'this' cannot be minified
const self = this;
// DiagAPI specific functions
const setLogger: DiagLoggerApi['setLogger'] = (
logger,
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }
) => {
if (logger === self) {
// There isn't much we can do here.
// Logging to the console might break the user application.
// Try to log to self. If a logger was previously registered it will receive the log.
const err = new Error(
'Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation'
);
self.error(err.stack ?? err.message);
return false;
}
if (typeof optionsOrLogLevel === 'number') {
optionsOrLogLevel = {
logLevel: optionsOrLogLevel,
};
}
const oldLogger = getGlobal('diag');
const newLogger = createLogLevelDiagLogger(
optionsOrLogLevel.logLevel ?? DiagLogLevel.INFO,
logger
);
// There already is an logger registered. We'll let it know before overwriting it.
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
const stack = new Error().stack ?? '<failed to generate stacktrace>';
oldLogger.warn(`Current logger will be overwritten from ${stack}`);
newLogger.warn(
`Current logger will overwrite one already registered from ${stack}`
);
}
return registerGlobal('diag', newLogger, self, true);
};
self.setLogger = setLogger;
self.disable = () => {
unregisterGlobal(API_NAME, self);
};
self.createComponentLogger = (options: ComponentLoggerOptions) => {
return new DiagComponentLogger(options);
};
self.verbose = _logProxy('verbose');
self.debug = _logProxy('debug');
self.info = _logProxy('info');
self.warn = _logProxy('warn');
self.error = _logProxy('error');
}
public setLogger!: DiagLoggerApi['setLogger'];
/**
*
*/
public createComponentLogger!: (
options: ComponentLoggerOptions
) => DiagLogger;
// DiagLogger implementation
public verbose!: DiagLogFunction;
public debug!: DiagLogFunction;
public info!: DiagLogFunction;
public warn!: DiagLogFunction;
public error!: DiagLogFunction;
/**
* Unregister the global logger and return to Noop
*/
public disable!: () => void;
}

View File

@ -14,15 +14,17 @@
* limitations under the License.
*/
import { Meter } from '../types/Meter';
import { MeterProvider } from '../types/MeterProvider';
import { NOOP_METER_PROVIDER } from '../NoopMeterProvider';
import { Meter, MeterOptions } from '../metrics/Meter';
import { MeterProvider } from '../metrics/MeterProvider';
import { NOOP_METER_PROVIDER } from '../metrics/NoopMeterProvider';
import {
API_BACKWARDS_COMPATIBILITY_VERSION,
GLOBAL_METRICS_API_KEY,
makeGetter,
_global,
} from './global-utils';
getGlobal,
registerGlobal,
unregisterGlobal,
} from '../internal/global-utils';
import { DiagAPI } from './diag';
const API_NAME = 'metrics';
/**
* Singleton object which represents the entry point to the OpenTelemetry Metrics API
@ -43,42 +45,33 @@ export class MetricsAPI {
}
/**
* Set the current global meter. Returns the initialized global meter provider.
* Set the current global meter provider.
* Returns true if the meter provider was successfully registered, else false.
*/
public setGlobalMeterProvider(provider: MeterProvider): MeterProvider {
if (_global[GLOBAL_METRICS_API_KEY]) {
// global meter provider has already been set
return this.getMeterProvider();
}
_global[GLOBAL_METRICS_API_KEY] = makeGetter(
API_BACKWARDS_COMPATIBILITY_VERSION,
provider,
NOOP_METER_PROVIDER
);
return provider;
public setGlobalMeterProvider(provider: MeterProvider): boolean {
return registerGlobal(API_NAME, provider, DiagAPI.instance());
}
/**
* Returns the global meter provider.
*/
public getMeterProvider(): MeterProvider {
return (
_global[GLOBAL_METRICS_API_KEY]?.(API_BACKWARDS_COMPATIBILITY_VERSION) ??
NOOP_METER_PROVIDER
);
return getGlobal(API_NAME) || NOOP_METER_PROVIDER;
}
/**
* Returns a meter from the global meter provider.
*/
public getMeter(name: string, version?: string): Meter {
return this.getMeterProvider().getMeter(name, version);
public getMeter(
name: string,
version?: string,
options?: MeterOptions
): Meter {
return this.getMeterProvider().getMeter(name, version, options);
}
/** Remove the global meter provider */
public disable(): void {
delete _global[GLOBAL_METRICS_API_KEY];
unregisterGlobal(API_NAME, DiagAPI.instance());
}
}

127
api/src/api/propagation.ts Normal file
View File

@ -0,0 +1,127 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from '../context/types';
import {
getGlobal,
registerGlobal,
unregisterGlobal,
} from '../internal/global-utils';
import { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';
import {
defaultTextMapGetter,
defaultTextMapSetter,
TextMapGetter,
TextMapPropagator,
TextMapSetter,
} from '../propagation/TextMapPropagator';
import {
getBaggage,
getActiveBaggage,
setBaggage,
deleteBaggage,
} from '../baggage/context-helpers';
import { createBaggage } from '../baggage/utils';
import { DiagAPI } from './diag';
const API_NAME = 'propagation';
const NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
/**
* Singleton object which represents the entry point to the OpenTelemetry Propagation API
*
* @since 1.0.0
*/
export class PropagationAPI {
private static _instance?: PropagationAPI;
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor() {}
/** Get the singleton instance of the Propagator API */
public static getInstance(): PropagationAPI {
if (!this._instance) {
this._instance = new PropagationAPI();
}
return this._instance;
}
/**
* Set the current propagator.
*
* @returns true if the propagator was successfully registered, else false
*/
public setGlobalPropagator(propagator: TextMapPropagator): boolean {
return registerGlobal(API_NAME, propagator, DiagAPI.instance());
}
/**
* Inject context into a carrier to be propagated inter-process
*
* @param context Context carrying tracing data to inject
* @param carrier carrier to inject context into
* @param setter Function used to set values on the carrier
*/
public inject<Carrier>(
context: Context,
carrier: Carrier,
setter: TextMapSetter<Carrier> = defaultTextMapSetter
): void {
return this._getGlobalPropagator().inject(context, carrier, setter);
}
/**
* Extract context from a carrier
*
* @param context Context which the newly created context will inherit from
* @param carrier Carrier to extract context from
* @param getter Function used to extract keys from a carrier
*/
public extract<Carrier>(
context: Context,
carrier: Carrier,
getter: TextMapGetter<Carrier> = defaultTextMapGetter
): Context {
return this._getGlobalPropagator().extract(context, carrier, getter);
}
/**
* Return a list of all fields which may be used by the propagator.
*/
public fields(): string[] {
return this._getGlobalPropagator().fields();
}
/** Remove the global propagator */
public disable() {
unregisterGlobal(API_NAME, DiagAPI.instance());
}
public createBaggage = createBaggage;
public getBaggage = getBaggage;
public getActiveBaggage = getActiveBaggage;
public setBaggage = setBaggage;
public deleteBaggage = deleteBaggage;
private _getGlobalPropagator(): TextMapPropagator {
return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;
}
}

115
api/src/api/trace.ts Normal file
View File

@ -0,0 +1,115 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
getGlobal,
registerGlobal,
unregisterGlobal,
} from '../internal/global-utils';
import { ProxyTracerProvider } from '../trace/ProxyTracerProvider';
import {
isSpanContextValid,
wrapSpanContext,
} from '../trace/spancontext-utils';
import { Tracer } from '../trace/tracer';
import { TracerProvider } from '../trace/tracer_provider';
import {
deleteSpan,
getActiveSpan,
getSpan,
getSpanContext,
setSpan,
setSpanContext,
} from '../trace/context-utils';
import { DiagAPI } from './diag';
const API_NAME = 'trace';
/**
* Singleton object which represents the entry point to the OpenTelemetry Tracing API
*
* @since 1.0.0
*/
export class TraceAPI {
private static _instance?: TraceAPI;
private _proxyTracerProvider = new ProxyTracerProvider();
/** Empty private constructor prevents end users from constructing a new instance of the API */
private constructor() {}
/** Get the singleton instance of the Trace API */
public static getInstance(): TraceAPI {
if (!this._instance) {
this._instance = new TraceAPI();
}
return this._instance;
}
/**
* Set the current global tracer.
*
* @returns true if the tracer provider was successfully registered, else false
*/
public setGlobalTracerProvider(provider: TracerProvider): boolean {
const success = registerGlobal(
API_NAME,
this._proxyTracerProvider,
DiagAPI.instance()
);
if (success) {
this._proxyTracerProvider.setDelegate(provider);
}
return success;
}
/**
* Returns the global tracer provider.
*/
public getTracerProvider(): TracerProvider {
return getGlobal(API_NAME) || this._proxyTracerProvider;
}
/**
* Returns a tracer from the global tracer provider.
*/
public getTracer(name: string, version?: string): Tracer {
return this.getTracerProvider().getTracer(name, version);
}
/** Remove the global tracer provider */
public disable() {
unregisterGlobal(API_NAME, DiagAPI.instance());
this._proxyTracerProvider = new ProxyTracerProvider();
}
public wrapSpanContext = wrapSpanContext;
public isSpanContextValid = isSpanContextValid;
public deleteSpan = deleteSpan;
public getSpan = getSpan;
public getActiveSpan = getActiveSpan;
public getSpanContext = getSpanContext;
public setSpan = setSpan;
public setSpanContext = setSpanContext;
}

View File

@ -0,0 +1,63 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ContextAPI } from '../api/context';
import { createContextKey } from '../context/context';
import { Context } from '../context/types';
import { Baggage } from './types';
/**
* Baggage key
*/
const BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
/**
* Retrieve the current baggage from the given context
*
* @param {Context} Context that manage all context values
* @returns {Baggage} Extracted baggage from the context
*/
export function getBaggage(context: Context): Baggage | undefined {
return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;
}
/**
* Retrieve the current baggage from the active/current context
*
* @returns {Baggage} Extracted baggage from the context
*/
export function getActiveBaggage(): Baggage | undefined {
return getBaggage(ContextAPI.getInstance().active());
}
/**
* Store a baggage in the given context
*
* @param {Context} Context that manage all context values
* @param {Baggage} baggage that will be set in the actual context
*/
export function setBaggage(context: Context, baggage: Baggage): Context {
return context.setValue(BAGGAGE_KEY, baggage);
}
/**
* Delete the baggage stored in the given context
*
* @param {Context} Context that manage all context values
*/
export function deleteBaggage(context: Context): Context {
return context.deleteValue(BAGGAGE_KEY);
}

View File

@ -0,0 +1,62 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Baggage, BaggageEntry } from '../types';
export class BaggageImpl implements Baggage {
private _entries: Map<string, BaggageEntry>;
constructor(entries?: Map<string, BaggageEntry>) {
this._entries = entries ? new Map(entries) : new Map();
}
getEntry(key: string): BaggageEntry | undefined {
const entry = this._entries.get(key);
if (!entry) {
return undefined;
}
return Object.assign({}, entry);
}
getAllEntries(): [string, BaggageEntry][] {
return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);
}
setEntry(key: string, entry: BaggageEntry): BaggageImpl {
const newBaggage = new BaggageImpl(this._entries);
newBaggage._entries.set(key, entry);
return newBaggage;
}
removeEntry(key: string): BaggageImpl {
const newBaggage = new BaggageImpl(this._entries);
newBaggage._entries.delete(key);
return newBaggage;
}
removeEntries(...keys: string[]): BaggageImpl {
const newBaggage = new BaggageImpl(this._entries);
for (const key of keys) {
newBaggage._entries.delete(key);
}
return newBaggage;
}
clear(): BaggageImpl {
return new BaggageImpl();
}
}

View File

@ -0,0 +1,20 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Symbol used to make BaggageEntryMetadata an opaque type
*/
export const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');

104
api/src/baggage/types.ts Normal file
View File

@ -0,0 +1,104 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { baggageEntryMetadataSymbol } from './internal/symbol';
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @since 1.0.0
*/
export interface BaggageEntry {
/** `String` value of the `BaggageEntry`. */
value: string;
/**
* Metadata is an optional string property defined by the W3C baggage specification.
* It currently has no special meaning defined by the specification.
*/
metadata?: BaggageEntryMetadata;
}
/**
* Serializable Metadata defined by the W3C baggage specification.
* It currently has no special meaning defined by the OpenTelemetry or W3C.
*
* @since 1.0.0
*/
export type BaggageEntryMetadata = { toString(): string } & {
__TYPE__: typeof baggageEntryMetadataSymbol;
};
/**
* Baggage represents collection of key-value pairs with optional metadata.
* Each key of Baggage is associated with exactly one value.
* Baggage may be used to annotate and enrich telemetry data.
*
* @since 1.0.0
*/
export interface Baggage {
/**
* Get an entry from Baggage if it exists
*
* @param key The key which identifies the BaggageEntry
*/
getEntry(key: string): BaggageEntry | undefined;
/**
* Get a list of all entries in the Baggage
*/
getAllEntries(): [string, BaggageEntry][];
/**
* Returns a new baggage with the entries from the current bag and the specified entry
*
* @param key string which identifies the baggage entry
* @param entry BaggageEntry for the given key
*/
setEntry(key: string, entry: BaggageEntry): Baggage;
/**
* Returns a new baggage with the entries from the current bag except the removed entry
*
* @param key key identifying the entry to be removed
*/
removeEntry(key: string): Baggage;
/**
* Returns a new baggage with the entries from the current bag except the removed entries
*
* @param key keys identifying the entries to be removed
*/
removeEntries(...key: string[]): Baggage;
/**
* Returns a new baggage with no entries
*/
clear(): Baggage;
}

58
api/src/baggage/utils.ts Normal file
View File

@ -0,0 +1,58 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DiagAPI } from '../api/diag';
import { BaggageImpl } from './internal/baggage-impl';
import { baggageEntryMetadataSymbol } from './internal/symbol';
import { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
const diag = DiagAPI.instance();
/**
* Create a new Baggage with optional entries
*
* @param entries An array of baggage entries the new baggage should contain
*/
export function createBaggage(
entries: Record<string, BaggageEntry> = {}
): Baggage {
return new BaggageImpl(new Map(Object.entries(entries)));
}
/**
* Create a serializable BaggageEntryMetadata object from a string.
*
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
*
* @since 1.0.0
*/
export function baggageEntryMetadataFromString(
str: string
): BaggageEntryMetadata {
if (typeof str !== 'string') {
diag.error(
`Cannot create baggage metadata from unknown type: ${typeof str}`
);
str = '';
}
return {
__TYPE__: baggageEntryMetadataSymbol,
toString() {
return str;
},
};
}

View File

@ -0,0 +1,41 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Attributes is a map from string to attribute values.
*
* Note: only the own enumerable keys are counted as valid attribute keys.
*
* @since 1.3.0
*/
export interface Attributes {
[attributeKey: string]: AttributeValue | undefined;
}
/**
* Attribute values may be any non-nullish primitive value except an object.
*
* null or undefined attribute values are invalid and will result in undefined behavior.
*
* @since 1.3.0
*/
export type AttributeValue =
| string
| number
| boolean
| Array<null | undefined | string>
| Array<null | undefined | number>
| Array<null | undefined | boolean>;

View File

@ -0,0 +1,49 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
interface ExceptionWithCode {
code: string | number;
name?: string;
message?: string;
stack?: string;
}
interface ExceptionWithMessage {
code?: string | number;
message: string;
name?: string;
stack?: string;
}
interface ExceptionWithName {
code?: string | number;
message?: string;
name: string;
stack?: string;
}
/**
* Defines Exception.
*
* string or an object with one of (message or name or code) and optional stack
*
* @since 1.0.0
*/
export type Exception =
| ExceptionWithCode
| ExceptionWithMessage
| ExceptionWithName
| string;

39
api/src/common/Time.ts Normal file
View File

@ -0,0 +1,39 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Defines High-Resolution Time.
*
* The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.
* The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.
* For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.
* The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds:
* HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.
* The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:
* HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000.
* This is represented in HrTime format as [1609504210, 150000000].
*
* @since 1.0.0
*/
export type HrTime = [number, number];
/**
* Defines TimeInput.
*
* hrtime, epoch milliseconds, performance.now() or Date
*
* @since 1.0.0
*/
export type TimeInput = HrTime | number | Date;

24
api/src/context-api.ts Normal file
View File

@ -0,0 +1,24 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { ContextAPI } from './api/context';
/**
* Entrypoint for context API
* @since 1.0.0
*/
export const context = ContextAPI.getInstance();

View File

@ -0,0 +1,45 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ROOT_CONTEXT } from './context';
import * as types from './types';
export class NoopContextManager implements types.ContextManager {
active(): types.Context {
return ROOT_CONTEXT;
}
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(
_context: types.Context,
fn: F,
thisArg?: ThisParameterType<F>,
...args: A
): ReturnType<F> {
return fn.call(thisArg, ...args);
}
bind<T>(_context: types.Context, target: T): T {
return target;
}
enable(): this {
return this;
}
disable(): this {
return this;
}
}

View File

@ -0,0 +1,93 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from './types';
/**
* Get a key to uniquely identify a context value
*
* @since 1.0.0
*/
export function createContextKey(description: string) {
// The specification states that for the same input, multiple calls should
// return different keys. Due to the nature of the JS dependency management
// system, this creates problems where multiple versions of some package
// could hold different keys for the same property.
//
// Therefore, we use Symbol.for which returns the same key for the same input.
return Symbol.for(description);
}
class BaseContext implements Context {
private _currentContext!: Map<symbol, unknown>;
/**
* Construct a new context which inherits values from an optional parent context.
*
* @param parentContext a context from which to inherit values
*/
constructor(parentContext?: Map<symbol, unknown>) {
// for minification
const self = this;
self._currentContext = parentContext ? new Map(parentContext) : new Map();
self.getValue = (key: symbol) => self._currentContext.get(key);
self.setValue = (key: symbol, value: unknown): Context => {
const context = new BaseContext(self._currentContext);
context._currentContext.set(key, value);
return context;
};
self.deleteValue = (key: symbol): Context => {
const context = new BaseContext(self._currentContext);
context._currentContext.delete(key);
return context;
};
}
/**
* Get a value from the context.
*
* @param key key which identifies a context value
*/
public getValue!: (key: symbol) => unknown;
/**
* Create a new context which inherits from this context and has
* the given key set to the given value.
*
* @param key context key for which to set the value
* @param value value to set for the given key
*/
public setValue!: (key: symbol, value: unknown) => Context;
/**
* Return a new context which inherits from this context but does
* not contain a value for the given key.
*
* @param key context key for which to clear a value
*/
public deleteValue!: (key: symbol) => Context;
}
/**
* The root context is used as the default parent context when there is no active context
*
* @since 1.0.0
*/
export const ROOT_CONTEXT: Context = new BaseContext();

85
api/src/context/types.ts Normal file
View File

@ -0,0 +1,85 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @since 1.0.0
*/
export interface Context {
/**
* Get a value from the context.
*
* @param key key which identifies a context value
*/
getValue(key: symbol): unknown;
/**
* Create a new context which inherits from this context and has
* the given key set to the given value.
*
* @param key context key for which to set the value
* @param value value to set for the given key
*/
setValue(key: symbol, value: unknown): Context;
/**
* Return a new context which inherits from this context but does
* not contain a value for the given key.
*
* @param key context key for which to clear a value
*/
deleteValue(key: symbol): Context;
}
/**
* @since 1.0.0
*/
export interface ContextManager {
/**
* Get the current active context
*/
active(): Context;
/**
* Run the fn callback with object set as the current active context
* @param context Any object to set as the current active context
* @param fn A callback to be immediately run within a specific context
* @param thisArg optional receiver to be used for calling fn
* @param args optional arguments forwarded to fn
*/
with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(
context: Context,
fn: F,
thisArg?: ThisParameterType<F>,
...args: A
): ReturnType<F>;
/**
* Bind an object as the current context (or a specific one)
* @param [context] Optionally specify the context which you want to assign
* @param target Any object to which a context need to be set
*/
bind<T>(context: Context, target: T): T;
/**
* Enable context management
*/
enable(): this;
/**
* Disable context management
*/
disable(): this;
}

28
api/src/diag-api.ts Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { DiagAPI } from './api/diag';
/**
* Entrypoint for Diag API.
* Defines Diagnostic handler used for internal diagnostic logging operations.
* The default provides a Noop DiagLogger implementation which may be changed via the
* diag.setLogger(logger: DiagLogger) function.
*
* @since 1.0.0
*/
export const diag = DiagAPI.instance();

View File

@ -0,0 +1,70 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getGlobal } from '../internal/global-utils';
import { ComponentLoggerOptions, DiagLogger, DiagLogFunction } from './types';
/**
* Component Logger which is meant to be used as part of any component which
* will add automatically additional namespace in front of the log message.
* It will then forward all message to global diag logger
* @example
* const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });
* cLogger.debug('test');
* // @opentelemetry/instrumentation-http test
*/
export class DiagComponentLogger implements DiagLogger {
private _namespace: string;
constructor(props: ComponentLoggerOptions) {
this._namespace = props.namespace || 'DiagComponentLogger';
}
public debug(...args: unknown[]): void {
return logProxy('debug', this._namespace, args);
}
public error(...args: unknown[]): void {
return logProxy('error', this._namespace, args);
}
public info(...args: unknown[]): void {
return logProxy('info', this._namespace, args);
}
public warn(...args: unknown[]): void {
return logProxy('warn', this._namespace, args);
}
public verbose(...args: unknown[]): void {
return logProxy('verbose', this._namespace, args);
}
}
function logProxy(
funcName: keyof DiagLogger,
namespace: string,
args: unknown[]
): void {
const logger = getGlobal('diag');
// shortcut if logger not set
if (!logger) {
return;
}
args.unshift(namespace);
return logger[funcName](...(args as Parameters<DiagLogFunction>));
}

View File

@ -0,0 +1,94 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DiagLogger, DiagLogFunction } from './types';
type ConsoleMapKeys = 'error' | 'warn' | 'info' | 'debug' | 'trace';
const consoleMap: { n: keyof DiagLogger; c: ConsoleMapKeys }[] = [
{ n: 'error', c: 'error' },
{ n: 'warn', c: 'warn' },
{ n: 'info', c: 'info' },
{ n: 'debug', c: 'debug' },
{ n: 'verbose', c: 'trace' },
];
/**
* A simple Immutable Console based diagnostic logger which will output any messages to the Console.
* If you want to limit the amount of logging to a specific level or lower use the
* {@link createLogLevelDiagLogger}
*
* @since 1.0.0
*/
export class DiagConsoleLogger implements DiagLogger {
constructor() {
function _consoleFunc(funcName: ConsoleMapKeys): DiagLogFunction {
return function (...args) {
if (console) {
// Some environments only expose the console when the F12 developer console is open
// eslint-disable-next-line no-console
let theFunc = console[funcName];
if (typeof theFunc !== 'function') {
// Not all environments support all functions
// eslint-disable-next-line no-console
theFunc = console.log;
}
// One last final check
if (typeof theFunc === 'function') {
return theFunc.apply(console, args);
}
}
};
}
for (let i = 0; i < consoleMap.length; i++) {
this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
}
}
/** Log an error scenario that was not expected and caused the requested operation to fail. */
public error!: DiagLogFunction;
/**
* Log a warning scenario to inform the developer of an issues that should be investigated.
* The requested operation may or may not have succeeded or completed.
*/
public warn!: DiagLogFunction;
/**
* Log a general informational message, this should not affect functionality.
* This is also the default logging level so this should NOT be used for logging
* debugging level information.
*/
public info!: DiagLogFunction;
/**
* Log a general debug message that can be useful for identifying a failure.
* Information logged at this level may include diagnostic details that would
* help identify a failure scenario. Useful scenarios would be to log the execution
* order of async operations
*/
public debug!: DiagLogFunction;
/**
* Log a detailed (verbose) trace level logging that can be used to identify failures
* where debug level logging would be insufficient, this level of tracing can include
* input and output parameters and as such may include PII information passing through
* the API. As such it is recommended that this level of tracing should not be enabled
* in a production environment.
*/
public verbose!: DiagLogFunction;
}

View File

@ -0,0 +1,51 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DiagLogFunction, DiagLogger, DiagLogLevel } from '../types';
export function createLogLevelDiagLogger(
maxLevel: DiagLogLevel,
logger: DiagLogger
): DiagLogger {
if (maxLevel < DiagLogLevel.NONE) {
maxLevel = DiagLogLevel.NONE;
} else if (maxLevel > DiagLogLevel.ALL) {
maxLevel = DiagLogLevel.ALL;
}
// In case the logger is null or undefined
logger = logger || {};
function _filterFunc(
funcName: keyof DiagLogger,
theLevel: DiagLogLevel
): DiagLogFunction {
const theFunc = logger[funcName];
if (typeof theFunc === 'function' && maxLevel >= theLevel) {
return theFunc.bind(logger);
}
return function () {};
}
return {
error: _filterFunc('error', DiagLogLevel.ERROR),
warn: _filterFunc('warn', DiagLogLevel.WARN),
info: _filterFunc('info', DiagLogLevel.INFO),
debug: _filterFunc('debug', DiagLogLevel.DEBUG),
verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),
};
}

View File

@ -0,0 +1,34 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DiagLogger } from '../types';
function noopLogFunction() {}
/**
* Returns a No-Op Diagnostic logger where all messages do nothing.
* @implements {@link DiagLogger}
* @returns {DiagLogger}
*/
export function createNoopDiagLogger(): DiagLogger {
return {
verbose: noopLogFunction,
debug: noopLogFunction,
info: noopLogFunction,
warn: noopLogFunction,
error: noopLogFunction,
};
}

142
api/src/diag/types.ts Normal file
View File

@ -0,0 +1,142 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @since 1.0.0
*/
export type DiagLogFunction = (message: string, ...args: unknown[]) => void;
/**
* Defines an internal diagnostic logger interface which is used to log internal diagnostic
* messages, you can set the default diagnostic logger via the {@link DiagAPI} setLogger function.
* API provided implementations include :-
* - a No-Op {@link createNoopDiagLogger}
* - a {@link DiagLogLevel} filtering wrapper {@link createLogLevelDiagLogger}
* - a general Console {@link DiagConsoleLogger} version.
*
* @since 1.0.0
*/
export interface DiagLogger {
/** Log an error scenario that was not expected and caused the requested operation to fail. */
error: DiagLogFunction;
/**
* Log a warning scenario to inform the developer of an issues that should be investigated.
* The requested operation may or may not have succeeded or completed.
*/
warn: DiagLogFunction;
/**
* Log a general informational message, this should not affect functionality.
* This is also the default logging level so this should NOT be used for logging
* debugging level information.
*/
info: DiagLogFunction;
/**
* Log a general debug message that can be useful for identifying a failure.
* Information logged at this level may include diagnostic details that would
* help identify a failure scenario.
* For example: Logging the order of execution of async operations.
*/
debug: DiagLogFunction;
/**
* Log a detailed (verbose) trace level logging that can be used to identify failures
* where debug level logging would be insufficient, this level of tracing can include
* input and output parameters and as such may include PII information passing through
* the API. As such it is recommended that this level of tracing should not be enabled
* in a production environment.
*/
verbose: DiagLogFunction;
}
/**
* Defines the available internal logging levels for the diagnostic logger, the numeric values
* of the levels are defined to match the original values from the initial LogLevel to avoid
* compatibility/migration issues for any implementation that assume the numeric ordering.
*/
export enum DiagLogLevel {
/** Diagnostic Logging level setting to disable all logging (except and forced logs) */
NONE = 0,
/** Identifies an error scenario */
ERROR = 30,
/** Identifies a warning scenario */
WARN = 50,
/** General informational log message */
INFO = 60,
/** General debug log message */
DEBUG = 70,
/**
* Detailed trace level logging should only be used for development, should only be set
* in a development environment.
*/
VERBOSE = 80,
/** Used to set the logging level to include all logging */
ALL = 9999,
}
/**
* Defines options for ComponentLogger
*
* @since 1.0.0
*/
export interface ComponentLoggerOptions {
namespace: string;
}
/**
* @since 1.4.1
*/
export interface DiagLoggerOptions {
/**
* The {@link DiagLogLevel} used to filter logs sent to the logger.
*
* @defaultValue DiagLogLevel.INFO
*/
logLevel?: DiagLogLevel;
/**
* Setting this value to `true` will suppress the warning message normally emitted when registering a logger when another logger is already registered.
*/
suppressOverrideMessage?: boolean;
}
export interface DiagLoggerApi {
/**
* Set the global DiagLogger and DiagLogLevel.
* If a global diag logger is already set, this will override it.
*
* @param logger - The {@link DiagLogger} instance to set as the default logger.
* @param options - A {@link DiagLoggerOptions} object. If not provided, default values will be set.
* @returns `true` if the logger was successfully registered, else `false`
*/
setLogger(logger: DiagLogger, options?: DiagLoggerOptions): boolean;
/**
*
* @param logger - The {@link DiagLogger} instance to set as the default logger.
* @param logLevel - The {@link DiagLogLevel} used to filter logs sent to the logger. If not provided it will default to {@link DiagLogLevel.INFO}.
* @returns `true` if the logger was successfully registered, else `false`
*/
setLogger(logger: DiagLogger, logLevel?: DiagLogLevel): boolean;
}

View File

@ -0,0 +1,23 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Any exports here may change at any time and without warning
* @module @opentelemetry/api/experimental
*/
export { wrapTracer, SugaredTracer } from './trace/SugaredTracer';
export type { SugaredSpanOptions } from './trace/SugaredOptions';

View File

@ -14,17 +14,16 @@
* limitations under the License.
*/
import { ShimWrapped } from '../common/types';
import { Span, SpanOptions } from '../../';
/**
* Checks if certain function has been already wrapped
* @param func
* Options needed for span creation
*/
export function isWrapped(func: unknown): func is ShimWrapped {
return (
typeof func === 'function' &&
typeof (func as ShimWrapped).__original === 'function' &&
typeof (func as ShimWrapped).__unwrap === 'function' &&
(func as ShimWrapped).__wrapped === true
);
export interface SugaredSpanOptions extends SpanOptions {
/**
* function to overwrite default exception behavior to record the exception. No exceptions should be thrown in the function.
* @param e Error which triggered this exception
* @param span current span from context
*/
onException?: (e: Error, span: Span) => void;
}

View File

@ -0,0 +1,215 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SugaredSpanOptions } from './SugaredOptions';
import { context, Context, Span, SpanStatusCode, Tracer } from '../../';
const defaultOnException = (e: Error, span: Span) => {
span.recordException(e);
span.setStatus({
code: SpanStatusCode.ERROR,
});
};
/**
* return a new SugaredTracer created from the supplied one
* @param tracer
*/
export function wrapTracer(tracer: Tracer): SugaredTracer {
return new SugaredTracer(tracer);
}
export class SugaredTracer implements Tracer {
private readonly _tracer: Tracer;
constructor(tracer: Tracer) {
this._tracer = tracer;
this.startSpan = tracer.startSpan.bind(this._tracer);
this.startActiveSpan = tracer.startActiveSpan.bind(this._tracer);
}
startActiveSpan: Tracer['startActiveSpan'];
startSpan: Tracer['startSpan'];
/**
* Starts a new {@link Span} and calls the given function passing it the
* created span as first argument.
* Additionally, the new span gets set in context and this context is activated
* for the duration of the function call.
* The span will be closed after the function has executed.
* If an exception occurs, it is recorded, the status is set to ERROR and the exception is rethrown.
*
* @param name The name of the span
* @param [options] SugaredSpanOptions used for span creation
* @param [context] Context to use to extract parent
* @param fn function called in the context of the span and receives the newly created span as an argument
* @returns return value of fn
* @example
* const something = tracer.withActiveSpan('op', span => {
* // do some work
* });
* @example
* const something = await tracer.withActiveSpan('op', span => {
* // do some async work
* });
*/
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
fn: F
): ReturnType<F>;
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SugaredSpanOptions,
fn: F
): ReturnType<F>;
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SugaredSpanOptions,
context: Context,
fn: F
): ReturnType<F>;
withActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
arg2: F | SugaredSpanOptions,
arg3?: F | Context,
arg4?: F
): ReturnType<F> {
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
return this._tracer.startActiveSpan(name, opts, ctx, (span: Span) =>
handleFn(span, opts, fn)
) as ReturnType<F>;
}
/**
* Starts a new {@link Span} and ends it after execution of fn without setting it on context.
* The span will be closed after the function has executed.
* If an exception occurs, it is recorded, the status is et to ERROR and rethrown.
*
* This method does NOT modify the current Context.
*
* @param name The name of the span
* @param [options] SugaredSpanOptions used for span creation
* @param [context] Context to use to extract parent
* @param fn function called in the context of the span and receives the newly created span as an argument
* @returns Span The newly created span
* @example
* const something = tracer.withSpan('op', span => {
* // do some work
* });
* @example
* const something = await tracer.withSpan('op', span => {
* // do some async work
* });
*/
withSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
fn: F
): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SugaredSpanOptions,
fn: F
): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SugaredSpanOptions,
context: Context,
fn: F
): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
options: SugaredSpanOptions,
context: Context,
fn: F
): ReturnType<F>;
withSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
arg2: SugaredSpanOptions | F,
arg3?: Context | F,
arg4?: F
): ReturnType<F> {
const { opts, ctx, fn } = massageParams(arg2, arg3, arg4);
const span = this._tracer.startSpan(name, opts, ctx);
return handleFn(span, opts, fn) as ReturnType<F>;
}
}
/**
* Massages parameters of withSpan and withActiveSpan to allow signature overwrites
* @param arg
* @param arg2
* @param arg3
*/
function massageParams<F extends (span: Span) => ReturnType<F>>(
arg: F | SugaredSpanOptions,
arg2?: F | Context,
arg3?: F
) {
let opts: SugaredSpanOptions | undefined;
let ctx: Context | undefined;
let fn: F;
if (!arg2 && !arg3) {
fn = arg as F;
} else if (!arg3) {
opts = arg as SugaredSpanOptions;
fn = arg2 as F;
} else {
opts = arg as SugaredSpanOptions;
ctx = arg2 as Context;
fn = arg3 as F;
}
opts = opts ?? {};
ctx = ctx ?? context.active();
return { opts, ctx, fn };
}
/**
* Executes fn, returns results and runs onException in the case of exception to allow overwriting of error handling
* @param span
* @param opts
* @param fn
*/
function handleFn<F extends (span: Span) => ReturnType<F>>(
span: Span,
opts: SugaredSpanOptions,
fn: F
): ReturnType<F> {
const onException = opts.onException ?? defaultOnException;
const errorHandler = (e: Error) => {
onException(e, span);
span.end();
throw e;
};
try {
const ret = fn(span) as Promise<ReturnType<F>>;
// if fn is an async function, attach a recordException and spanEnd callback to the promise
if (typeof ret?.then === 'function') {
return ret.then(val => {
span.end();
return val;
}, errorHandler) as ReturnType<F>;
}
span.end();
return ret as ReturnType<F>;
} catch (e) {
// add throw to signal the compiler that this will throw in the inner scope
throw errorHandler(e);
}
}

133
api/src/index.ts Normal file
View File

@ -0,0 +1,133 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @module @opentelemetry/api
*/
export type {
BaggageEntry,
BaggageEntryMetadata,
Baggage,
} from './baggage/types';
export { baggageEntryMetadataFromString } from './baggage/utils';
export type { Exception } from './common/Exception';
export type { HrTime, TimeInput } from './common/Time';
export type { Attributes, AttributeValue } from './common/Attributes';
// Context APIs
export { createContextKey, ROOT_CONTEXT } from './context/context';
export type { Context, ContextManager } from './context/types';
export type { ContextAPI } from './api/context';
// Diag APIs
export { DiagConsoleLogger } from './diag/consoleLogger';
export { DiagLogLevel } from './diag/types';
export type {
DiagLogFunction,
DiagLogger,
ComponentLoggerOptions,
DiagLoggerOptions,
} from './diag/types';
export type { DiagAPI } from './api/diag';
// Metrics APIs
export { createNoopMeter } from './metrics/NoopMeter';
export type { MeterOptions, Meter } from './metrics/Meter';
export type { MeterProvider } from './metrics/MeterProvider';
export { ValueType } from './metrics/Metric';
export type {
Counter,
Gauge,
Histogram,
MetricOptions,
Observable,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
BatchObservableCallback,
MetricAdvice,
MetricAttributes,
MetricAttributeValue,
ObservableCallback,
} from './metrics/Metric';
export type {
BatchObservableResult,
ObservableResult,
} from './metrics/ObservableResult';
export type { MetricsAPI } from './api/metrics';
// Propagation APIs
export {
defaultTextMapGetter,
defaultTextMapSetter,
} from './propagation/TextMapPropagator';
export type {
TextMapPropagator,
TextMapSetter,
TextMapGetter,
} from './propagation/TextMapPropagator';
export type { PropagationAPI } from './api/propagation';
// Trace APIs
export type { SpanAttributes, SpanAttributeValue } from './trace/attributes';
export type { Link } from './trace/link';
export { ProxyTracer, type TracerDelegator } from './trace/ProxyTracer';
export { ProxyTracerProvider } from './trace/ProxyTracerProvider';
export type { Sampler } from './trace/Sampler';
export { SamplingDecision, type SamplingResult } from './trace/SamplingResult';
export type { SpanContext } from './trace/span_context';
export { SpanKind } from './trace/span_kind';
export type { Span } from './trace/span';
export type { SpanOptions } from './trace/SpanOptions';
export { type SpanStatus, SpanStatusCode } from './trace/status';
export { TraceFlags } from './trace/trace_flags';
export type { TraceState } from './trace/trace_state';
export { createTraceState } from './trace/internal/utils';
export type { TracerProvider } from './trace/tracer_provider';
export type { Tracer } from './trace/tracer';
export type { TracerOptions } from './trace/tracer_options';
export {
isSpanContextValid,
isValidTraceId,
isValidSpanId,
} from './trace/spancontext-utils';
export {
INVALID_SPANID,
INVALID_TRACEID,
INVALID_SPAN_CONTEXT,
} from './trace/invalid-span-constants';
export type { TraceAPI } from './api/trace';
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { context } from './context-api';
import { diag } from './diag-api';
import { metrics } from './metrics-api';
import { propagation } from './propagation-api';
import { trace } from './trace-api';
// Named export.
export { context, diag, metrics, propagation, trace };
// Default export.
export default {
context,
diag,
metrics,
propagation,
trace,
};

View File

@ -0,0 +1,104 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MeterProvider } from '../metrics/MeterProvider';
import { ContextManager } from '../context/types';
import { DiagLogger } from '../diag/types';
import { _globalThis } from '../platform';
import { TextMapPropagator } from '../propagation/TextMapPropagator';
import type { TracerProvider } from '../trace/tracer_provider';
import { VERSION } from '../version';
import { isCompatible } from './semver';
const major = VERSION.split('.')[0];
const GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(
`opentelemetry.js.api.${major}`
);
const _global = _globalThis as OTelGlobal;
export function registerGlobal<Type extends keyof OTelGlobalAPI>(
type: Type,
instance: OTelGlobalAPI[Type],
diag: DiagLogger,
allowOverride = false
): boolean {
const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = _global[
GLOBAL_OPENTELEMETRY_API_KEY
] ?? {
version: VERSION,
});
if (!allowOverride && api[type]) {
// already registered an API of this type
const err = new Error(
`@opentelemetry/api: Attempted duplicate registration of API: ${type}`
);
diag.error(err.stack || err.message);
return false;
}
if (api.version !== VERSION) {
// All registered APIs must be of the same version exactly
const err = new Error(
`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`
);
diag.error(err.stack || err.message);
return false;
}
api[type] = instance;
diag.debug(
`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`
);
return true;
}
export function getGlobal<Type extends keyof OTelGlobalAPI>(
type: Type
): OTelGlobalAPI[Type] | undefined {
const globalVersion = _global[GLOBAL_OPENTELEMETRY_API_KEY]?.version;
if (!globalVersion || !isCompatible(globalVersion)) {
return;
}
return _global[GLOBAL_OPENTELEMETRY_API_KEY]?.[type];
}
export function unregisterGlobal(type: keyof OTelGlobalAPI, diag: DiagLogger) {
diag.debug(
`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`
);
const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
if (api) {
delete api[type];
}
}
type OTelGlobal = {
[GLOBAL_OPENTELEMETRY_API_KEY]?: OTelGlobalAPI;
};
type OTelGlobalAPI = {
version: string;
diag?: DiagLogger;
trace?: TracerProvider;
context?: ContextManager;
metrics?: MeterProvider;
propagation?: TextMapPropagator;
};

140
api/src/internal/semver.ts Normal file
View File

@ -0,0 +1,140 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { VERSION } from '../version';
const re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
/**
* Create a function to test an API version to see if it is compatible with the provided ownVersion.
*
* The returned function has the following semantics:
* - Exact match is always compatible
* - Major versions must match exactly
* - 1.x package cannot use global 2.x package
* - 2.x package cannot use global 1.x package
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
* - Patch and build tag differences are not considered at this time
*
* @param ownVersion version which should be checked against
*/
export function _makeCompatibilityCheck(
ownVersion: string
): (globalVersion: string) => boolean {
const acceptedVersions = new Set<string>([ownVersion]);
const rejectedVersions = new Set<string>();
const myVersionMatch = ownVersion.match(re);
if (!myVersionMatch) {
// we cannot guarantee compatibility so we always return noop
return () => false;
}
const ownVersionParsed = {
major: +myVersionMatch[1],
minor: +myVersionMatch[2],
patch: +myVersionMatch[3],
prerelease: myVersionMatch[4],
};
// if ownVersion has a prerelease tag, versions must match exactly
if (ownVersionParsed.prerelease != null) {
return function isExactmatch(globalVersion: string): boolean {
return globalVersion === ownVersion;
};
}
function _reject(v: string) {
rejectedVersions.add(v);
return false;
}
function _accept(v: string) {
acceptedVersions.add(v);
return true;
}
return function isCompatible(globalVersion: string): boolean {
if (acceptedVersions.has(globalVersion)) {
return true;
}
if (rejectedVersions.has(globalVersion)) {
return false;
}
const globalVersionMatch = globalVersion.match(re);
if (!globalVersionMatch) {
// cannot parse other version
// we cannot guarantee compatibility so we always noop
return _reject(globalVersion);
}
const globalVersionParsed = {
major: +globalVersionMatch[1],
minor: +globalVersionMatch[2],
patch: +globalVersionMatch[3],
prerelease: globalVersionMatch[4],
};
// if globalVersion has a prerelease tag, versions must match exactly
if (globalVersionParsed.prerelease != null) {
return _reject(globalVersion);
}
// major versions must match
if (ownVersionParsed.major !== globalVersionParsed.major) {
return _reject(globalVersion);
}
if (ownVersionParsed.major === 0) {
if (
ownVersionParsed.minor === globalVersionParsed.minor &&
ownVersionParsed.patch <= globalVersionParsed.patch
) {
return _accept(globalVersion);
}
return _reject(globalVersion);
}
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
return _accept(globalVersion);
}
return _reject(globalVersion);
};
}
/**
* Test an API version to see if it is compatible with this API.
*
* - Exact match is always compatible
* - Major versions must match exactly
* - 1.x package cannot use global 2.x package
* - 2.x package cannot use global 1.x package
* - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API
* - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
* - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
* - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
* - Patch and build tag differences are not considered at this time
*
* @param version version of the API requesting an instance of the global API
*/
export const isCompatible = _makeCompatibilityCheck(VERSION);

25
api/src/metrics-api.ts Normal file
View File

@ -0,0 +1,25 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { MetricsAPI } from './api/metrics';
/**
* Entrypoint for metrics API
*
* @since 1.3.0
*/
export const metrics = MetricsAPI.getInstance();

190
api/src/metrics/Meter.ts Normal file
View File

@ -0,0 +1,190 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
BatchObservableCallback,
Counter,
Gauge,
Histogram,
MetricAttributes,
MetricOptions,
Observable,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
} from './Metric';
/**
* An interface describes additional metadata of a meter.
*
* @since 1.3.0
*/
export interface MeterOptions {
/**
* The schemaUrl of the meter or instrumentation library
*/
schemaUrl?: string;
}
/**
* An interface to allow the recording metrics.
*
* {@link Metric}s are used for recording pre-defined aggregation (`Counter`),
* or raw values (`Histogram`) in which the aggregation and attributes
* for the exported metric are deferred.
*
* @since 1.3.0
*/
export interface Meter {
/**
* Creates and returns a new `Gauge`.
* @param name the name of the metric.
* @param [options] the metric options.
*/
createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(
name: string,
options?: MetricOptions
): Gauge<AttributesTypes>;
/**
* Creates and returns a new `Histogram`.
* @param name the name of the metric.
* @param [options] the metric options.
*/
createHistogram<AttributesTypes extends MetricAttributes = MetricAttributes>(
name: string,
options?: MetricOptions
): Histogram<AttributesTypes>;
/**
* Creates a new `Counter` metric. Generally, this kind of metric when the
* value is a quantity, the sum is of primary interest, and the event count
* and value distribution are not of primary interest.
* @param name the name of the metric.
* @param [options] the metric options.
*/
createCounter<AttributesTypes extends MetricAttributes = MetricAttributes>(
name: string,
options?: MetricOptions
): Counter<AttributesTypes>;
/**
* Creates a new `UpDownCounter` metric. UpDownCounter is a synchronous
* instrument and very similar to Counter except that Add(increment)
* supports negative increments. It is generally useful for capturing changes
* in an amount of resources used, or any quantity that rises and falls
* during a request.
* Example uses for UpDownCounter:
* <ol>
* <li> count the number of active requests. </li>
* <li> count memory in use by instrumenting new and delete. </li>
* <li> count queue size by instrumenting enqueue and dequeue. </li>
* <li> count semaphore up and down operations. </li>
* </ol>
*
* @param name the name of the metric.
* @param [options] the metric options.
*/
createUpDownCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
name: string,
options?: MetricOptions
): UpDownCounter<AttributesTypes>;
/**
* Creates a new `ObservableGauge` metric.
*
* The callback SHOULD be safe to be invoked concurrently.
*
* @param name the name of the metric.
* @param [options] the metric options.
*/
createObservableGauge<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
name: string,
options?: MetricOptions
): ObservableGauge<AttributesTypes>;
/**
* Creates a new `ObservableCounter` metric.
*
* The callback SHOULD be safe to be invoked concurrently.
*
* @param name the name of the metric.
* @param [options] the metric options.
*/
createObservableCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
name: string,
options?: MetricOptions
): ObservableCounter<AttributesTypes>;
/**
* Creates a new `ObservableUpDownCounter` metric.
*
* The callback SHOULD be safe to be invoked concurrently.
*
* @param name the name of the metric.
* @param [options] the metric options.
*/
createObservableUpDownCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
name: string,
options?: MetricOptions
): ObservableUpDownCounter<AttributesTypes>;
/**
* Sets up a function that will be called whenever a metric collection is
* initiated.
*
* If the function is already in the list of callbacks for this Observable,
* the function is not added a second time.
*
* Only the associated observables can be observed in the callback.
* Measurements of observables that are not associated observed in the
* callback are dropped.
*
* @param callback the batch observable callback
* @param observables the observables associated with this batch observable callback
*/
addBatchObservableCallback<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
callback: BatchObservableCallback<AttributesTypes>,
observables: Observable<AttributesTypes>[]
): void;
/**
* Removes a callback previously registered with {@link Meter.addBatchObservableCallback}.
*
* The callback to be removed is identified using a combination of the callback itself,
* and the set of the observables associated with it.
*
* @param callback the batch observable callback
* @param observables the observables associated with this batch observable callback
*/
removeBatchObservableCallback<
AttributesTypes extends MetricAttributes = MetricAttributes,
>(
callback: BatchObservableCallback<AttributesTypes>,
observables: Observable<AttributesTypes>[]
): void;
}

View File

@ -14,19 +14,22 @@
* limitations under the License.
*/
import { Meter } from './Meter';
import { Meter, MeterOptions } from './Meter';
/**
* A registry for creating named {@link Meter}s.
*
* @since 1.3.0
*/
export interface MeterProvider {
/**
* Returns a Meter, creating one if one with the given name and version is
* not already created.
* Returns a Meter, creating one if one with the given name, version, and
* schemaUrl pair is not already created.
*
* @param name The name of the meter or instrumentation library.
* @param version The version of the meter or instrumentation library.
* @param options The options of the meter or instrumentation library.
* @returns Meter A Meter with the given name and version
*/
getMeter(name: string, version?: string): Meter;
getMeter(name: string, version?: string, options?: MeterOptions): Meter;
}

209
api/src/metrics/Metric.ts Normal file
View File

@ -0,0 +1,209 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Attributes, AttributeValue } from '../common/Attributes';
import { Context } from '../context/types';
import { BatchObservableResult, ObservableResult } from './ObservableResult';
/**
* Advisory options influencing aggregation configuration parameters.
*
* @since 1.7.0
* @experimental
*/
export interface MetricAdvice {
/**
* Hint the explicit bucket boundaries for SDK if the metric is been
* aggregated with a HistogramAggregator.
*/
explicitBucketBoundaries?: number[];
}
/**
* Options needed for metric creation
*
* @since 1.3.0
*/
export interface MetricOptions {
/**
* The description of the Metric.
* @default ''
*/
description?: string;
/**
* The unit of the Metric values.
* @default ''
*/
unit?: string;
/**
* Indicates the type of the recorded value.
* @default {@link ValueType.DOUBLE}
*/
valueType?: ValueType;
/**
* The advice influencing aggregation configuration parameters.
* @experimental
* @since 1.7.0
*/
advice?: MetricAdvice;
}
/**
* The Type of value. It describes how the data is reported.
*
* @since 1.3.0
*/
export enum ValueType {
INT,
DOUBLE,
}
/**
* Counter is the most common synchronous instrument. This instrument supports
* an `Add(increment)` function for reporting a sum, and is restricted to
* non-negative increments. The default aggregation is Sum, as for any additive
* instrument.
*
* Example uses for Counter:
* <ol>
* <li> count the number of bytes received. </li>
* <li> count the number of requests completed. </li>
* <li> count the number of accounts created. </li>
* <li> count the number of checkpoints run. </li>
* <li> count the number of 5xx errors. </li>
* <ol>
*
* @since 1.3.0
*/
export interface Counter<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Increment value of counter by the input. Inputs must not be negative.
*/
add(value: number, attributes?: AttributesTypes, context?: Context): void;
}
/**
* @since 1.3.0
*/
export interface UpDownCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Increment value of counter by the input. Inputs may be negative.
*/
add(value: number, attributes?: AttributesTypes, context?: Context): void;
}
/**
* @since 1.9.0
*/
export interface Gauge<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Records a measurement.
*/
record(value: number, attributes?: AttributesTypes, context?: Context): void;
}
/**
* @since 1.3.0
*/
export interface Histogram<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Records a measurement. Value of the measurement must not be negative.
*/
record(value: number, attributes?: AttributesTypes, context?: Context): void;
}
/**
* @deprecated please use {@link Attributes}
* @since 1.3.0
*/
export type MetricAttributes = Attributes;
/**
* @deprecated please use {@link AttributeValue}
* @since 1.3.0
*/
export type MetricAttributeValue = AttributeValue;
/**
* The observable callback for Observable instruments.
*
* @since 1.3.0
*/
export type ObservableCallback<
AttributesTypes extends MetricAttributes = MetricAttributes,
> = (
observableResult: ObservableResult<AttributesTypes>
) => void | Promise<void>;
/**
* The observable callback for a batch of Observable instruments.
*
* @since 1.3.0
*/
export type BatchObservableCallback<
AttributesTypes extends MetricAttributes = MetricAttributes,
> = (
observableResult: BatchObservableResult<AttributesTypes>
) => void | Promise<void>;
/**
* @since 1.3.0
*/
export interface Observable<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Sets up a function that will be called whenever a metric collection is initiated.
*
* If the function is already in the list of callbacks for this Observable, the function is not added a second time.
*/
addCallback(callback: ObservableCallback<AttributesTypes>): void;
/**
* Removes a callback previously registered with {@link Observable.addCallback}.
*/
removeCallback(callback: ObservableCallback<AttributesTypes>): void;
}
/**
* @since 1.3.0
*/
export type ObservableCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
> = Observable<AttributesTypes>;
/**
* @since 1.3.0
*/
export type ObservableUpDownCounter<
AttributesTypes extends MetricAttributes = MetricAttributes,
> = Observable<AttributesTypes>;
/**
* @since 1.3.0
*/
export type ObservableGauge<
AttributesTypes extends MetricAttributes = MetricAttributes,
> = Observable<AttributesTypes>;

View File

@ -0,0 +1,172 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Meter } from './Meter';
import {
BatchObservableCallback,
Counter,
Gauge,
Histogram,
MetricAttributes,
MetricOptions,
Observable,
ObservableCallback,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
} from './Metric';
/**
* NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
* constant NoopMetrics for all of its methods.
*/
export class NoopMeter implements Meter {
constructor() {}
/**
* @see {@link Meter.createGauge}
*/
createGauge(_name: string, _options?: MetricOptions): Gauge {
return NOOP_GAUGE_METRIC;
}
/**
* @see {@link Meter.createHistogram}
*/
createHistogram(_name: string, _options?: MetricOptions): Histogram {
return NOOP_HISTOGRAM_METRIC;
}
/**
* @see {@link Meter.createCounter}
*/
createCounter(_name: string, _options?: MetricOptions): Counter {
return NOOP_COUNTER_METRIC;
}
/**
* @see {@link Meter.createUpDownCounter}
*/
createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter {
return NOOP_UP_DOWN_COUNTER_METRIC;
}
/**
* @see {@link Meter.createObservableGauge}
*/
createObservableGauge(
_name: string,
_options?: MetricOptions
): ObservableGauge {
return NOOP_OBSERVABLE_GAUGE_METRIC;
}
/**
* @see {@link Meter.createObservableCounter}
*/
createObservableCounter(
_name: string,
_options?: MetricOptions
): ObservableCounter {
return NOOP_OBSERVABLE_COUNTER_METRIC;
}
/**
* @see {@link Meter.createObservableUpDownCounter}
*/
createObservableUpDownCounter(
_name: string,
_options?: MetricOptions
): ObservableUpDownCounter {
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
}
/**
* @see {@link Meter.addBatchObservableCallback}
*/
addBatchObservableCallback(
_callback: BatchObservableCallback,
_observables: Observable[]
): void {}
/**
* @see {@link Meter.removeBatchObservableCallback}
*/
removeBatchObservableCallback(_callback: BatchObservableCallback): void {}
}
export class NoopMetric {}
export class NoopCounterMetric extends NoopMetric implements Counter {
add(_value: number, _attributes: MetricAttributes): void {}
}
export class NoopUpDownCounterMetric
extends NoopMetric
implements UpDownCounter
{
add(_value: number, _attributes: MetricAttributes): void {}
}
export class NoopGaugeMetric extends NoopMetric implements Gauge {
record(_value: number, _attributes: MetricAttributes): void {}
}
export class NoopHistogramMetric extends NoopMetric implements Histogram {
record(_value: number, _attributes: MetricAttributes): void {}
}
export class NoopObservableMetric {
addCallback(_callback: ObservableCallback) {}
removeCallback(_callback: ObservableCallback) {}
}
export class NoopObservableCounterMetric
extends NoopObservableMetric
implements ObservableCounter {}
export class NoopObservableGaugeMetric
extends NoopObservableMetric
implements ObservableGauge {}
export class NoopObservableUpDownCounterMetric
extends NoopObservableMetric
implements ObservableUpDownCounter {}
export const NOOP_METER = new NoopMeter();
// Synchronous instruments
export const NOOP_COUNTER_METRIC = new NoopCounterMetric();
export const NOOP_GAUGE_METRIC = new NoopGaugeMetric();
export const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
export const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
// Asynchronous instruments
export const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
export const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
export const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC =
new NoopObservableUpDownCounterMetric();
/**
* Create a no-op Meter
*
* @since 1.3.0
*/
export function createNoopMeter(): Meter {
return NOOP_METER;
}

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import { Meter } from './types/Meter';
import { MeterProvider } from './types/MeterProvider';
import { Meter, MeterOptions } from './Meter';
import { MeterProvider } from './MeterProvider';
import { NOOP_METER } from './NoopMeter';
/**
@ -23,7 +23,7 @@ import { NOOP_METER } from './NoopMeter';
* for all calls to `getMeter`
*/
export class NoopMeterProvider implements MeterProvider {
getMeter(_name?: string, _version?: string): Meter {
getMeter(_name: string, _version?: string, _options?: MeterOptions): Meter {
return NOOP_METER;
}
}

View File

@ -0,0 +1,63 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MetricAttributes, Observable } from './Metric';
/**
* Interface that is being used in callback function for Observable Metric.
*
* @since 1.3.0
*/
export interface ObservableResult<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Observe a measurement of the value associated with the given attributes.
*
* @param value The value to be observed.
* @param attributes The attributes associated with the value. If more than
* one values associated with the same attributes values, SDK may pick the
* last one or simply drop the entire observable result.
*/
observe(
this: ObservableResult<AttributesTypes>,
value: number,
attributes?: AttributesTypes
): void;
}
/**
* Interface that is being used in batch observable callback function.
*/
export interface BatchObservableResult<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Observe a measurement of the value associated with the given attributes.
*
* @param metric The observable metric to be observed.
* @param value The value to be observed.
* @param attributes The attributes associated with the value. If more than
* one values associated with the same attributes values, SDK may pick the
* last one or simply drop the entire observable result.
*/
observe(
this: BatchObservableResult<AttributesTypes>,
metric: Observable<AttributesTypes>,
value: number,
attributes?: AttributesTypes
): void;
}

View File

@ -0,0 +1,38 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Updates to this file should also be replicated to @opentelemetry/core too.
/**
* - globalThis (New standard)
* - self (Will return the current window instance for supported browsers)
* - window (fallback for older browser implementations)
* - global (NodeJS implementation)
* - <object> (When all else fails)
*/
/** only globals that common to node and browsers are allowed */
// eslint-disable-next-line node/no-unsupported-features/es-builtins, no-undef
export const _globalThis: typeof globalThis =
typeof globalThis === 'object'
? globalThis
: typeof self === 'object'
? self
: typeof window === 'object'
? window
: typeof global === 'object'
? (global as unknown as typeof globalThis)
: ({} as typeof globalThis);

View File

@ -0,0 +1,17 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { _globalThis } from './globalThis';

View File

@ -14,4 +14,4 @@
* limitations under the License.
*/
export * from './globalThis';
export { _globalThis } from './node';

View File

@ -0,0 +1,17 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { _globalThis } from './globalThis';

View File

@ -0,0 +1,25 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { PropagationAPI } from './api/propagation';
/**
* Entrypoint for propagation API
*
* @since 1.0.0
*/
export const propagation = PropagationAPI.getInstance();

View File

@ -0,0 +1,33 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from '../context/types';
import { TextMapPropagator } from './TextMapPropagator';
/**
* No-op implementations of {@link TextMapPropagator}.
*/
export class NoopTextMapPropagator implements TextMapPropagator {
/** Noop inject function does nothing */
inject(_context: Context, _carrier: unknown): void {}
/** Noop extract function does nothing and returns the input context */
extract(context: Context, _carrier: unknown): Context {
return context;
}
fields(): string[] {
return [];
}
}

View File

@ -0,0 +1,152 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from '../context/types';
/**
* Injects `Context` into and extracts it from carriers that travel
* in-band across process boundaries. Encoding is expected to conform to the
* HTTP Header Field semantics. Values are often encoded as RPC/HTTP request
* headers.
*
* The carrier of propagated data on both the client (injector) and server
* (extractor) side is usually an object such as http headers. Propagation is
* usually implemented via library-specific request interceptors, where the
* client-side injects values and the server-side extracts them.
*
* @since 1.0.0
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface TextMapPropagator<Carrier = any> {
/**
* Injects values from a given `Context` into a carrier.
*
* OpenTelemetry defines a common set of format values (TextMapPropagator),
* and each has an expected `carrier` type.
*
* @param context the Context from which to extract values to transmit over
* the wire.
* @param carrier the carrier of propagation fields, such as http request
* headers.
* @param setter an optional {@link TextMapSetter}. If undefined, values will be
* set by direct object assignment.
*/
inject(
context: Context,
carrier: Carrier,
setter: TextMapSetter<Carrier>
): void;
/**
* Given a `Context` and a carrier, extract context values from a
* carrier and return a new context, created from the old context, with the
* extracted values.
*
* @param context the Context from which to extract values to transmit over
* the wire.
* @param carrier the carrier of propagation fields, such as http request
* headers.
* @param getter an optional {@link TextMapGetter}. If undefined, keys will be all
* own properties, and keys will be accessed by direct object access.
*/
extract(
context: Context,
carrier: Carrier,
getter: TextMapGetter<Carrier>
): Context;
/**
* Return a list of all fields which may be used by the propagator.
*/
fields(): string[];
}
/**
* A setter is specified by the caller to define a specific method
* to set key/value pairs on the carrier within a propagator
*
* @since 1.0.0
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface TextMapSetter<Carrier = any> {
/**
* Callback used to set a key/value pair on an object.
*
* Should be called by the propagator each time a key/value pair
* should be set, and should set that key/value pair on the propagator.
*
* @param carrier object or class which carries key/value pairs
* @param key string key to modify
* @param value value to be set to the key on the carrier
*/
set(carrier: Carrier, key: string, value: string): void;
}
/**
* A getter is specified by the caller to define a specific method
* to get the value of a key from a carrier.
*
* @since 1.0.0
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface TextMapGetter<Carrier = any> {
/**
* Get a list of all keys available on the carrier.
*
* @param carrier
*/
keys(carrier: Carrier): string[];
/**
* Get the value of a specific key from the carrier.
*
* @param carrier
* @param key
*/
get(carrier: Carrier, key: string): undefined | string | string[];
}
/**
* @since 1.0.0
*/
export const defaultTextMapGetter: TextMapGetter = {
get(carrier, key) {
if (carrier == null) {
return undefined;
}
return carrier[key];
},
keys(carrier) {
if (carrier == null) {
return [];
}
return Object.keys(carrier);
},
};
/**
* @since 1.0.0
*/
export const defaultTextMapSetter: TextMapSetter = {
set(carrier, key, value) {
if (carrier == null) {
return;
}
carrier[key] = value;
},
};

26
api/src/trace-api.ts Normal file
View File

@ -0,0 +1,26 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Split module-level variable definition into separate files to allow
// tree-shaking on each api instance.
import { TraceAPI } from './api/trace';
/**
* Entrypoint for trace API
*
* @since 1.0.0
*/
export const trace = TraceAPI.getInstance();

View File

@ -0,0 +1,84 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Exception } from '../common/Exception';
import { TimeInput } from '../common/Time';
import { SpanAttributes } from './attributes';
import { INVALID_SPAN_CONTEXT } from './invalid-span-constants';
import { Span } from './span';
import { SpanContext } from './span_context';
import { SpanStatus } from './status';
import { Link } from './link';
/**
* The NonRecordingSpan is the default {@link Span} that is used when no Span
* implementation is available. All operations are no-op including context
* propagation.
*/
export class NonRecordingSpan implements Span {
constructor(
private readonly _spanContext: SpanContext = INVALID_SPAN_CONTEXT
) {}
// Returns a SpanContext.
spanContext(): SpanContext {
return this._spanContext;
}
// By default does nothing
setAttribute(_key: string, _value: unknown): this {
return this;
}
// By default does nothing
setAttributes(_attributes: SpanAttributes): this {
return this;
}
// By default does nothing
addEvent(_name: string, _attributes?: SpanAttributes): this {
return this;
}
addLink(_link: Link): this {
return this;
}
addLinks(_links: Link[]): this {
return this;
}
// By default does nothing
setStatus(_status: SpanStatus): this {
return this;
}
// By default does nothing
updateName(_name: string): this {
return this;
}
// By default does nothing
end(_endTime?: TimeInput): void {}
// isRecording always returns false for NonRecordingSpan.
isRecording(): boolean {
return false;
}
// By default does nothing
recordException(_exception: Exception, _time?: TimeInput): void {}
}

113
api/src/trace/NoopTracer.ts Normal file
View File

@ -0,0 +1,113 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ContextAPI } from '../api/context';
import { Context } from '../context/types';
import { getSpanContext, setSpan } from '../trace/context-utils';
import { NonRecordingSpan } from './NonRecordingSpan';
import { Span } from './span';
import { isSpanContextValid } from './spancontext-utils';
import { SpanOptions } from './SpanOptions';
import { SpanContext } from './span_context';
import { Tracer } from './tracer';
const contextApi = ContextAPI.getInstance();
/**
* No-op implementations of {@link Tracer}.
*/
export class NoopTracer implements Tracer {
// startSpan starts a noop span.
startSpan(
name: string,
options?: SpanOptions,
context = contextApi.active()
): Span {
const root = Boolean(options?.root);
if (root) {
return new NonRecordingSpan();
}
const parentFromContext = context && getSpanContext(context);
if (
isSpanContext(parentFromContext) &&
isSpanContextValid(parentFromContext)
) {
return new NonRecordingSpan(parentFromContext);
} else {
return new NonRecordingSpan();
}
}
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
fn: F
): ReturnType<F>;
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
opts: SpanOptions | undefined,
fn: F
): ReturnType<F>;
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
opts: SpanOptions | undefined,
ctx: Context | undefined,
fn: F
): ReturnType<F>;
startActiveSpan<F extends (span: Span) => ReturnType<F>>(
name: string,
arg2?: F | SpanOptions,
arg3?: F | Context,
arg4?: F
): ReturnType<F> | undefined {
let opts: SpanOptions | undefined;
let ctx: Context | undefined;
let fn: F;
if (arguments.length < 2) {
return;
} else if (arguments.length === 2) {
fn = arg2 as F;
} else if (arguments.length === 3) {
opts = arg2 as SpanOptions | undefined;
fn = arg3 as F;
} else {
opts = arg2 as SpanOptions | undefined;
ctx = arg3 as Context | undefined;
fn = arg4 as F;
}
const parentContext = ctx ?? contextApi.active();
const span = this.startSpan(name, opts, parentContext);
const contextWithSpanSet = setSpan(parentContext, span);
return contextApi.with(contextWithSpanSet, fn, undefined, span);
}
}
function isSpanContext(spanContext: unknown): spanContext is SpanContext {
return (
spanContext !== null &&
typeof spanContext === 'object' &&
'spanId' in spanContext &&
typeof spanContext['spanId'] === 'string' &&
'traceId' in spanContext &&
typeof spanContext['traceId'] === 'string' &&
'traceFlags' in spanContext &&
typeof spanContext['traceFlags'] === 'number'
);
}

View File

@ -0,0 +1,36 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { NoopTracer } from './NoopTracer';
import { Tracer } from './tracer';
import { TracerOptions } from './tracer_options';
import { TracerProvider } from './tracer_provider';
/**
* An implementation of the {@link TracerProvider} which returns an impotent
* Tracer for all calls to `getTracer`.
*
* All operations are no-op.
*/
export class NoopTracerProvider implements TracerProvider {
getTracer(
_name?: string,
_version?: string,
_options?: TracerOptions
): Tracer {
return new NoopTracer();
}
}

View File

@ -0,0 +1,89 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from '../context/types';
import { NoopTracer } from './NoopTracer';
import { Span } from './span';
import { SpanOptions } from './SpanOptions';
import { Tracer } from './tracer';
import { TracerOptions } from './tracer_options';
const NOOP_TRACER = new NoopTracer();
/**
* Proxy tracer provided by the proxy tracer provider
*
* @since 1.0.0
*/
export class ProxyTracer implements Tracer {
// When a real implementation is provided, this will be it
private _delegate?: Tracer;
constructor(
private _provider: TracerDelegator,
public readonly name: string,
public readonly version?: string,
public readonly options?: TracerOptions
) {}
startSpan(name: string, options?: SpanOptions, context?: Context): Span {
return this._getTracer().startSpan(name, options, context);
}
startActiveSpan<F extends (span: Span) => unknown>(
_name: string,
_options: F | SpanOptions,
_context?: F | Context,
_fn?: F
): ReturnType<F> {
const tracer = this._getTracer();
return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
}
/**
* Try to get a tracer from the proxy tracer provider.
* If the proxy tracer provider has no delegate, return a noop tracer.
*/
private _getTracer() {
if (this._delegate) {
return this._delegate;
}
const tracer = this._provider.getDelegateTracer(
this.name,
this.version,
this.options
);
if (!tracer) {
return NOOP_TRACER;
}
this._delegate = tracer;
return this._delegate;
}
}
/**
* @since 1.0.3
*/
export interface TracerDelegator {
getDelegateTracer(
name: string,
version?: string,
options?: TracerOptions
): Tracer | undefined;
}

View File

@ -0,0 +1,66 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Tracer } from './tracer';
import { TracerProvider } from './tracer_provider';
import { ProxyTracer } from './ProxyTracer';
import { NoopTracerProvider } from './NoopTracerProvider';
import { TracerOptions } from './tracer_options';
const NOOP_TRACER_PROVIDER = new NoopTracerProvider();
/**
* Tracer provider which provides {@link ProxyTracer}s.
*
* Before a delegate is set, tracers provided are NoOp.
* When a delegate is set, traces are provided from the delegate.
* When a delegate is set after tracers have already been provided,
* all tracers already provided will use the provided delegate implementation.
*
* @since 1.0.0
*/
export class ProxyTracerProvider implements TracerProvider {
private _delegate?: TracerProvider;
/**
* Get a {@link ProxyTracer}
*/
getTracer(name: string, version?: string, options?: TracerOptions): Tracer {
return (
this.getDelegateTracer(name, version, options) ??
new ProxyTracer(this, name, version, options)
);
}
getDelegate(): TracerProvider {
return this._delegate ?? NOOP_TRACER_PROVIDER;
}
/**
* Set the delegate tracer provider
*/
setDelegate(delegate: TracerProvider) {
this._delegate = delegate;
}
getDelegateTracer(
name: string,
version?: string,
options?: TracerOptions
): Tracer | undefined {
return this._delegate?.getTracer(name, version, options);
}
}

57
api/src/trace/Sampler.ts Normal file
View File

@ -0,0 +1,57 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Context } from '../context/types';
import { SpanAttributes } from './attributes';
import { Link } from './link';
import { SamplingResult } from './SamplingResult';
import { SpanKind } from './span_kind';
/**
* @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
* This interface represent a sampler. Sampling is a mechanism to control the
* noise and overhead introduced by OpenTelemetry by reducing the number of
* samples of traces collected and sent to the backend.
*
* @since 1.0.0
*/
export interface Sampler {
/**
* Checks whether span needs to be created and tracked.
*
* @param context Parent Context which may contain a span.
* @param traceId of the span to be created. It can be different from the
* traceId in the {@link SpanContext}. Typically in situations when the
* span to be created starts a new trace.
* @param spanName of the span to be created.
* @param spanKind of the span to be created.
* @param attributes Initial set of SpanAttributes for the Span being constructed.
* @param links Collection of links that will be associated with the Span to
* be created. Typically useful for batch operations.
* @returns a {@link SamplingResult}.
*/
shouldSample(
context: Context,
traceId: string,
spanName: string,
spanKind: SpanKind,
attributes: SpanAttributes,
links: Link[]
): SamplingResult;
/** Returns the sampler name or short description with the configuration. */
toString(): string;
}

View File

@ -0,0 +1,70 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SpanAttributes } from './attributes';
import { TraceState } from './trace_state';
/**
* @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
* A sampling decision that determines how a {@link Span} will be recorded
* and collected.
*
* @since 1.0.0
*/
export enum SamplingDecision {
/**
* `Span.isRecording() === false`, span will not be recorded and all events
* and attributes will be dropped.
*/
NOT_RECORD,
/**
* `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}
* MUST NOT be set.
*/
RECORD,
/**
* `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}
* MUST be set.
*/
RECORD_AND_SAMPLED,
}
/**
* @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.
* A sampling result contains a decision for a {@link Span} and additional
* attributes the sampler would like to added to the Span.
*
* @since 1.0.0
*/
export interface SamplingResult {
/**
* A sampling decision, refer to {@link SamplingDecision} for details.
*/
decision: SamplingDecision;
/**
* The list of attributes returned by SamplingResult MUST be immutable.
* Caller may call {@link Sampler}.shouldSample any number of times and
* can safely cache the returned value.
*/
attributes?: Readonly<SpanAttributes>;
/**
* A {@link TraceState} that will be associated with the {@link Span} through
* the new {@link SpanContext}. Samplers SHOULD return the TraceState from
* the passed-in {@link Context} if they do not intend to change it. Leaving
* the value undefined will also leave the TraceState unchanged.
*/
traceState?: TraceState;
}

View File

@ -0,0 +1,45 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TimeInput } from '../common/Time';
import { SpanAttributes } from './attributes';
import { Link } from './link';
import { SpanKind } from './span_kind';
/**
* Options needed for span creation
*
* @since 1.0.0
*/
export interface SpanOptions {
/**
* The SpanKind of a span
* @default {@link SpanKind.INTERNAL}
*/
kind?: SpanKind;
/** A span's attributes */
attributes?: SpanAttributes;
/** {@link Link}s span to other spans */
links?: Link[];
/** A manually specified start time for the created `Span` object. */
startTime?: TimeInput;
/** The new span should be a root span. (Ignore parent from context). */
root?: boolean;
}

View File

@ -0,0 +1,29 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Attributes, AttributeValue } from '../common/Attributes';
/**
* @deprecated please use {@link Attributes}
* @since 1.0.0
*/
export type SpanAttributes = Attributes;
/**
* @deprecated please use {@link AttributeValue}
* @since 1.0.0
*/
export type SpanAttributeValue = AttributeValue;

View File

@ -0,0 +1,85 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { createContextKey } from '../context/context';
import { Context } from '../context/types';
import { Span } from './span';
import { SpanContext } from './span_context';
import { NonRecordingSpan } from './NonRecordingSpan';
import { ContextAPI } from '../api/context';
/**
* span key
*/
const SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');
/**
* Return the span if one exists
*
* @param context context to get span from
*/
export function getSpan(context: Context): Span | undefined {
return (context.getValue(SPAN_KEY) as Span) || undefined;
}
/**
* Gets the span from the current context, if one exists.
*/
export function getActiveSpan(): Span | undefined {
return getSpan(ContextAPI.getInstance().active());
}
/**
* Set the span on a context
*
* @param context context to use as parent
* @param span span to set active
*/
export function setSpan(context: Context, span: Span): Context {
return context.setValue(SPAN_KEY, span);
}
/**
* Remove current span stored in the context
*
* @param context context to delete span from
*/
export function deleteSpan(context: Context): Context {
return context.deleteValue(SPAN_KEY);
}
/**
* Wrap span context in a NoopSpan and set as span in a new
* context
*
* @param context context to set active span on
* @param spanContext span context to be wrapped
*/
export function setSpanContext(
context: Context,
spanContext: SpanContext
): Context {
return setSpan(context, new NonRecordingSpan(spanContext));
}
/**
* Get the span context of the span if it exists.
*
* @param context context to get values from
*/
export function getSpanContext(context: Context): SpanContext | undefined {
return getSpan(context)?.spanContext();
}

View File

@ -0,0 +1,110 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TraceState } from '../trace_state';
import { validateKey, validateValue } from './tracestate-validators';
const MAX_TRACE_STATE_ITEMS = 32;
const MAX_TRACE_STATE_LEN = 512;
const LIST_MEMBERS_SEPARATOR = ',';
const LIST_MEMBER_KEY_VALUE_SPLITTER = '=';
/**
* TraceState must be a class and not a simple object type because of the spec
* requirement (https://www.w3.org/TR/trace-context/#tracestate-field).
*
* Here is the list of allowed mutations:
* - New key-value pair should be added into the beginning of the list
* - The value of any key can be updated. Modified keys MUST be moved to the
* beginning of the list.
*/
export class TraceStateImpl implements TraceState {
private _internalState: Map<string, string> = new Map();
constructor(rawTraceState?: string) {
if (rawTraceState) this._parse(rawTraceState);
}
set(key: string, value: string): TraceStateImpl {
// TODO: Benchmark the different approaches(map vs list) and
// use the faster one.
const traceState = this._clone();
if (traceState._internalState.has(key)) {
traceState._internalState.delete(key);
}
traceState._internalState.set(key, value);
return traceState;
}
unset(key: string): TraceStateImpl {
const traceState = this._clone();
traceState._internalState.delete(key);
return traceState;
}
get(key: string): string | undefined {
return this._internalState.get(key);
}
serialize(): string {
return this._keys()
.reduce((agg: string[], key) => {
agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));
return agg;
}, [])
.join(LIST_MEMBERS_SEPARATOR);
}
private _parse(rawTraceState: string) {
if (rawTraceState.length > MAX_TRACE_STATE_LEN) return;
this._internalState = rawTraceState
.split(LIST_MEMBERS_SEPARATOR)
.reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning
.reduce((agg: Map<string, string>, part: string) => {
const listMember = part.trim(); // Optional Whitespace (OWS) handling
const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);
if (i !== -1) {
const key = listMember.slice(0, i);
const value = listMember.slice(i + 1, part.length);
if (validateKey(key) && validateValue(value)) {
agg.set(key, value);
} else {
// TODO: Consider to add warning log
}
}
return agg;
}, new Map());
// Because of the reverse() requirement, trunc must be done after map is created
if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {
this._internalState = new Map(
Array.from(this._internalState.entries())
.reverse() // Use reverse same as original tracestate parse chain
.slice(0, MAX_TRACE_STATE_ITEMS)
);
}
}
private _keys(): string[] {
return Array.from(this._internalState.keys()).reverse();
}
private _clone(): TraceStateImpl {
const traceState = new TraceStateImpl();
traceState._internalState = new Map(this._internalState);
return traceState;
}
}

View File

@ -0,0 +1,45 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';
const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;
const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;
const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);
const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;
const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;
/**
* Key is opaque string up to 256 characters printable. It MUST begin with a
* lowercase letter, and can only contain lowercase letters a-z, digits 0-9,
* underscores _, dashes -, asterisks *, and forward slashes /.
* For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the
* vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.
* see https://www.w3.org/TR/trace-context/#key
*/
export function validateKey(key: string): boolean {
return VALID_KEY_REGEX.test(key);
}
/**
* Value is opaque string up to 256 characters printable ASCII RFC0020
* characters (i.e., the range 0x20 to 0x7E) except comma , and =.
*/
export function validateValue(value: string): boolean {
return (
VALID_VALUE_BASE_REGEX.test(value) &&
!INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)
);
}

View File

@ -14,14 +14,12 @@
* limitations under the License.
*/
import {
MetricDescriptor,
AggregatorKind,
MetricRecord,
} from '@opentelemetry/sdk-metrics-base';
import { TraceState } from '../trace_state';
import { TraceStateImpl } from './tracestate-impl';
export interface PrometheusCheckpoint {
descriptor: MetricDescriptor;
aggregatorKind: AggregatorKind;
records: MetricRecord[];
/**
* @since 1.1.0
*/
export function createTraceState(rawTraceState?: string): TraceState {
return new TraceStateImpl(rawTraceState);
}

View File

@ -0,0 +1,37 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { SpanContext } from './span_context';
import { TraceFlags } from './trace_flags';
/**
* @since 1.0.0
*/
export const INVALID_SPANID = '0000000000000000';
/**
* @since 1.0.0
*/
export const INVALID_TRACEID = '00000000000000000000000000000000';
/**
* @since 1.0.0
*/
export const INVALID_SPAN_CONTEXT: SpanContext = {
traceId: INVALID_TRACEID,
spanId: INVALID_SPANID,
traceFlags: TraceFlags.NONE,
};

Some files were not shown because too many files have changed in this diff Show More