Skip to content

Commit

Permalink
chore(otel-core): replace deprecated spanAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieDanielson committed Jan 9, 2024
1 parent ba00147 commit ea50f05
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
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.

6 changes: 3 additions & 3 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,11 +88,11 @@
"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"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core",
"sideEffects": false
}
}
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 ea50f05

Please sign in to comment.