Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use weaver to generate latest semconv 1.27 #4690

Merged
merged 58 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
307d017
feat(semconv): update semantic conventions to 1.25
dyladan May 9, 2024
a7e5212
Deprecate old values names
dyladan May 9, 2024
fe400cb
Change prefix and deprecate old names
dyladan May 9, 2024
f782cb6
Changelog
dyladan May 9, 2024
dc3f50a
Improve enum docs
dyladan May 10, 2024
f72598e
Remove commented code
dyladan May 10, 2024
e9fcfba
Merge branch 'main' into semconv-1.25
dyladan May 13, 2024
1505866
Merge branch 'main' into semconv-1.25
dyladan May 14, 2024
7036118
Remove errant file
dyladan May 21, 2024
07278df
Remove class name
dyladan May 21, 2024
727d23e
Blank line between metrics
dyladan May 21, 2024
79738a4
Fix newlines
dyladan May 21, 2024
c982f3e
Fix casing
dyladan May 21, 2024
a827bb7
main export should be stable only
dyladan May 22, 2024
a8295e7
Merge branch 'main' into semconv-1.25
dyladan May 22, 2024
fbc64da
Add experimental index
dyladan May 22, 2024
72561ba
Use singular value infix
dyladan May 22, 2024
31da43d
Add const types to semconv
dyladan May 23, 2024
3949f1f
Use VAL_ prefix for enum values
dyladan May 30, 2024
7499c3a
Merge remote-tracking branch 'origin/main' into semconv-1.25
dyladan Jun 5, 2024
d520b12
Merge branch 'main' into semconv-1.25
dyladan Jun 5, 2024
a9be96d
Do not format generated files
dyladan Jun 6, 2024
87d8f38
Merge branch 'semconv-1.25' of github.com:dynatrace-oss-contrib/opent…
dyladan Jun 6, 2024
2dce2eb
Enum infix
dyladan Jun 6, 2024
dbb8328
Use new semconv name generation to avoid conflicts
dyladan Jun 6, 2024
9ef2f46
Use builtin filter in macro
dyladan Jun 6, 2024
9bd9802
Merge remote-tracking branch 'origin/main' into semconv-1.25
dyladan Jun 6, 2024
c5163b5
Merge remote-tracking branch 'origin/main' into semconv-1.25
dyladan Jul 17, 2024
ce47611
Move to weaver
dyladan Jul 25, 2024
0b61394
Merge remote-tracking branch 'origin/main' into semconv-1.25
dyladan Jul 25, 2024
d88363b
Remove lint from semconv package
dyladan Aug 1, 2024
97aac66
Add template generators
dyladan Aug 1, 2024
49b68e7
Merge branch 'main' into semconv-1.25
dyladan Aug 1, 2024
c93c57b
Update to 0.8.0 generator
dyladan Aug 2, 2024
504f09a
Change entrypoint to incubating
dyladan Aug 2, 2024
cb11d1f
Change typesversions to incubating
dyladan Aug 2, 2024
6870633
Remove stable export, default export is stable
dyladan Aug 2, 2024
984f827
Merge remote-tracking branch 'origin/main' into semconv-1.25
dyladan Aug 2, 2024
f9cdde8
Remove tsbuildinfo
dyladan Aug 2, 2024
da5ae01
Print enum values and do not squash underscores
dyladan Aug 2, 2024
720ed64
Update to 1.27
dyladan Aug 2, 2024
af81446
Apply suggestions from review
dyladan Aug 2, 2024
ba26b28
Consolidate templates
dyladan Aug 2, 2024
bb6708e
Explicit stability in ctx
dyladan Aug 2, 2024
8bfbdf1
Changelog
dyladan Aug 2, 2024
fc56c56
Formatting fixes
dyladan Aug 2, 2024
f6e1f11
Apply suggestions from code review
dyladan Aug 5, 2024
3438499
Remove errant entry from changelog
dyladan Aug 5, 2024
85b18b8
Rename constants in deprecated comment
dyladan Aug 5, 2024
25eeaee
Remove ATTR prefix from enum values
dyladan Aug 5, 2024
9e4887d
Update semconv readme
dyladan Aug 5, 2024
29d7efb
Run code gen
dyladan Aug 5, 2024
478bb09
Add examples to docstring
dyladan Aug 5, 2024
fe150a8
Fix changelog lint
dyladan Aug 5, 2024
b51a249
Fix readme import
dyladan Aug 6, 2024
de3cf38
Export string as const for better type safety
dyladan Aug 7, 2024
fe748a1
Update scripts/semconv/templates/registry/stable/docstring.ts.j2
dyladan Aug 7, 2024
2844f01
Generate semconv
dyladan Aug 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
### :rocket: (Enhancement)

* feat: include instrumentation scope info in console span and log record exporters [#4848](https://github.com/open-telemetry/opentelemetry-js/pull/4848) @blumamir
* feat(semconv): update semantic conventions to 1.27 (from 1.7.0) [#4690](https://github.com/open-telemetry/opentelemetry-js/pull/4690) @dyladan
* Exported names have changed to `ATTR_{name}` for attributes (e.g. `ATTR_HTTP_REQUEST_METHOD`), `{name}_VALUE_{value}` for enumeration values (e.g. `HTTP_REQUEST_METHOD_VALUE_POST`), and `METRIC_{name}` for metrics. Exported names from previous versions are deprecated.
* Import `@opentelemetry/semantic-conventions` for *stable* semantic conventions. Import `@opentelemetry/semantic-conventions/incubating` for all semantic conventions, stable and unstable.

### :bug: (Bug Fix)

Expand Down
43 changes: 40 additions & 3 deletions packages/opentelemetry-semantic-conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,51 @@ Semantic Convention constants for use with the OpenTelemetry SDK/APIs. [This doc
npm install --save @opentelemetry/semantic-conventions
```

## Import Structure

This package has 2 separate exports.
The main export (`@opentelemetry/semantic-conventions`) includes only stable semantic conventions.
It is subject to the restrictions of semantic versioning 2.0.
The `/incubating` export (`@opentelemetry/semantic-conventions/incubating`) contains all stable and unstable semantic conventions.
It is _NOT_ subject to the restrictions of semantic versioning and _MAY_ contain breaking changes in minor releases.

## Usage

### Stable SemConv

```ts
import {
ATTR_NETWORK_PEER_ADDRESS,
ATTR_NETWORK_PEER_PORT,
ATTR_NETWORK_PROTOCOL_NAME,
ATTR_NETWORK_PROTOCOL_VERSION,
NETWORK_TRANSPORT_VALUE_TCP,
} from '@opentelemetry/semantic-conventions';

const span = tracer.startSpan(spanName, spanOptions)
.setAttributes({
[ATTR_NETWORK_PEER_ADDRESS]: 'localhost',
[ATTR_NETWORK_PEER_PORT]: 8080,
[ATTR_NETWORK_PROTOCOL_NAME]: 'http',
[ATTR_NETWORK_PROTOCOL_VERSION]: '1.1',
[ATTR_NETWORK_TRANSPORT]: NETWORK_TRANSPORT_VALUE_TCP,
});
```

### Unstable SemConv

```ts
import { SemanticAttributes } from '@opentelemetry/semantic-conventions';
import {
ATTR_PROCESS_COMMAND,
ATTR_PROCESS_COMMAND_ARGS,
ATTR_PROCESS_COMMAND_LINE,
} from '@opentelemetry/semantic-conventions/incubating';

const span = tracer.startSpan().startSpan(spanName, spanOptions)
const span = tracer.startSpan(spanName, spanOptions)
.setAttributes({
[SemanticAttributes.NET_PEER_NAME]: 'localhost',
[ATTR_PROCESS_COMMAND]: 'cat',
[ATTR_PROCESS_COMMAND_ARGS]: ['file1', 'file2'],
[ATTR_CONTAINER_COMMAND_LINE]: 'cat file1 file2',
});
```

Expand Down
26 changes: 24 additions & 2 deletions packages/opentelemetry-semantic-conventions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,35 @@
"module": "build/esm/index.js",
"esnext": "build/esnext/index.js",
"types": "build/src/index.d.ts",
"exports": {
".": {
"module": "./build/esm/index.js",
"esnext": "./build/esnext/index.js",
"types": "./build/src/index.d.ts",
"default": "./build/src/index.js"
},
"./incubating": {
"module": "./build/esm/index-incubating.js",
"esnext": "./build/esnext/index-incubating.js",
"types": "./build/src/index-incubating.d.ts",
"default": "./build/src/index-incubating.js"
}
},
"typesVersions": {
"*": {
"*": [
"./build/src/index.d.ts"
],
"incubating": [
"./build/src/index-incubating.d.ts"
]
}
},
"repository": "open-telemetry/opentelemetry-js",
"scripts": {
"prepublishOnly": "npm run compile",
"compile": "tsc --build tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"version": "node ../../scripts/version-update.js",
"watch": "tsc --build --watch tsconfig.json tsconfig.esm.json tsconfig.esnext.json",
"precompile": "cross-var lerna run version --scope $npm_package_name --include-dependencies",
Expand Down
Loading