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

chore(otel-core): replace deprecated SpanAttributes #4408

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### :boom: Breaking Change

* chore(otel-core): replace deprecated SpanAttributes [#4408](https://github.com/open-telemetry/opentelemetry-js/pull/4408) @JamieDanielson

### :rocket: (Enhancement)

### :books: (Refine Doc)
Expand Down
30 changes: 6 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/opentelemetry-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"access": "public"
},
"devDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.8.0",
"@opentelemetry/api": ">=1.1.0 <1.8.0",
"@types/mocha": "10.0.6",
"@types/node": "18.6.5",
"@types/sinon": "10.0.20",
Expand All @@ -88,7 +88,7 @@
"webpack": "4.46.0"
},
"peerDependencies": {
"@opentelemetry/api": ">=1.0.0 <1.8.0"
"@opentelemetry/api": ">=1.1.0 <1.8.0"
},
"dependencies": {
"@opentelemetry/semantic-conventions": "1.18.1"
Expand Down
8 changes: 4 additions & 4 deletions packages/opentelemetry-core/src/common/attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import { diag, SpanAttributeValue, SpanAttributes } from '@opentelemetry/api';
import { diag, AttributeValue, Attributes } from '@opentelemetry/api';

export function sanitizeAttributes(attributes: unknown): SpanAttributes {
const out: SpanAttributes = {};
export function sanitizeAttributes(attributes: unknown): Attributes {
const out: Attributes = {};

if (typeof attributes !== 'object' || attributes == null) {
return out;
Expand Down Expand Up @@ -46,7 +46,7 @@ export function isAttributeKey(key: unknown): key is string {
return typeof key === 'string' && key.length > 0;
}

export function isAttributeValue(val: unknown): val is SpanAttributeValue {
export function isAttributeValue(val: unknown): val is AttributeValue {
if (val == null) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
Link,
Sampler,
SamplingResult,
SpanAttributes,
Attributes,
SpanKind,
TraceFlags,
trace,
Expand Down Expand Up @@ -66,7 +66,7 @@ export class ParentBasedSampler implements Sampler {
traceId: string,
spanName: string,
spanKind: SpanKind,
attributes: SpanAttributes,
attributes: Attributes,
links: Link[]
): SamplingResult {
const parentContext = trace.getSpanContext(context);
Expand Down
Loading