@ogcio/o11y-sdk-node 0.11.4 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ export type GeoInput = {
7
7
  lon?: number;
8
8
  country?: string;
9
9
  city?: string;
10
+ precision?: number;
10
11
  };
11
12
  /**
12
13
  * Returns geo attributes from the given OTel context's baggage.
@@ -44,7 +44,8 @@ export function createGeoAttributesFrom(input) {
44
44
  input.lat <= 90 &&
45
45
  input.lon >= -180 &&
46
46
  input.lon <= 180) {
47
- const hash = encodeGeohash(input.lat, input.lon, 4);
47
+ const precision = input.precision ?? 4;
48
+ const hash = encodeGeohash(input.lat, input.lon, precision);
48
49
  if (hash)
49
50
  attrs["geo.hash"] = hash;
50
51
  }
@@ -1,5 +1,5 @@
1
1
  import buildNodeInstrumentation from "./lib/instrumentation.node.js";
2
- export type { Span, SpanStatus } from "@opentelemetry/api";
2
+ export type { Span, SpanStatus, Attributes, ObservableResult, } from "@opentelemetry/api";
3
3
  export { SpanKind, SpanStatusCode, TraceFlags, type Exception, } from "@opentelemetry/api";
4
4
  export type * from "./lib/index.js";
5
5
  export type { NodeSDK } from "@opentelemetry/sdk-node";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/o11y-sdk-node",
3
- "version": "0.11.4",
3
+ "version": "0.12.0",
4
4
  "description": "Opentelemetry standard instrumentation SDK for NodeJS based project",
5
5
  "main": "dist/sdk-node/index.js",
6
6
  "types": "dist/sdk-node/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ogcio/o11y-sdk-node",
3
- "version": "0.11.4",
3
+ "version": "0.12.0",
4
4
  "description": "Opentelemetry standard instrumentation SDK for NodeJS based project",
5
5
  "main": "dist/sdk-node/index.js",
6
6
  "types": "dist/sdk-node/index.d.ts",