Skip to content

Commit

Permalink
chore(otel-core): replace deprecated SpanAttributes (#4408)
Browse files Browse the repository at this point in the history
* chore(otel-core): replace deprecated spanAttributes

* update changelog

* keep new line at bottom of package.json
  • Loading branch information
JamieDanielson authored Jan 17, 2024
1 parent fac6d14 commit 7f613e0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 32 deletions.
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

0 comments on commit 7f613e0

Please sign in to comment.