autotel-backends 2.12.28 → 2.12.30

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.
package/dist/grafana.d.ts CHANGED
@@ -1,75 +1,53 @@
1
- import { AutotelConfig } from 'autotel';
2
- import { LogRecordProcessor } from '@opentelemetry/sdk-logs';
3
-
4
- /**
5
- * Grafana Cloud preset for autotel
6
- *
7
- * Provides a simplified configuration helper for sending traces, metrics,
8
- * and logs to Grafana Cloud via the OTLP gateway.
9
- *
10
- * Get your endpoint and headers from:
11
- * Grafana Cloud Portal → your stack → Connections → OpenTelemetry → Configure
12
- *
13
- * @example
14
- * ```typescript
15
- * import { init } from 'autotel';
16
- * import { createGrafanaConfig } from 'autotel-backends/grafana';
17
- *
18
- * init(createGrafanaConfig({
19
- * endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT!,
20
- * headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
21
- * service: 'my-app',
22
- * enableLogs: true,
23
- * }));
24
- * ```
25
- */
1
+ import { AutotelConfig } from "autotel";
2
+ import { LogRecordProcessor } from "@opentelemetry/sdk-logs";
26
3
 
4
+ //#region src/grafana.d.ts
27
5
  /**
28
6
  * Configuration options for Grafana Cloud preset
29
7
  */
30
8
  interface GrafanaPresetConfig {
31
- /**
32
- * OTLP gateway endpoint (required).
33
- * From Grafana Cloud: Stack → Connections → OpenTelemetry → Configure.
34
- * Example: https://otlp-gateway-prod-gb-south-1.grafana.net/otlp
35
- */
36
- endpoint: string;
37
- /**
38
- * OTLP authentication headers.
39
- * From the same Configure tile; usually Basic auth.
40
- * Example: "Authorization=Basic%20BASE64_INSTANCE_ID_AND_TOKEN"
41
- * or object: { Authorization: 'Basic ...' }
42
- */
43
- headers?: string | Record<string, string>;
44
- /**
45
- * Service name (required).
46
- * Appears in Tempo, Mimir, and Loki as service_name.
47
- */
48
- service: string;
49
- /**
50
- * Deployment environment (e.g. 'production', 'staging').
51
- *
52
- * @default process.env.NODE_ENV || 'development'
53
- */
54
- environment?: string;
55
- /**
56
- * Service version for deployment tracking.
57
- *
58
- * @default process.env.OTEL_SERVICE_VERSION
59
- */
60
- version?: string;
61
- /**
62
- * Enable log export to Grafana Cloud (Loki) via OTLP.
63
- * When true, configures logRecordProcessors so OTel Logs API records are exported.
64
- *
65
- * @default true
66
- */
67
- enableLogs?: boolean;
68
- /**
69
- * Custom log record processors (advanced).
70
- * Overrides the default OTLP log processor when enableLogs is true.
71
- */
72
- logRecordProcessors?: LogRecordProcessor[];
9
+ /**
10
+ * OTLP gateway endpoint (required).
11
+ * From Grafana Cloud: Stack → Connections → OpenTelemetry → Configure.
12
+ * Example: https://otlp-gateway-prod-gb-south-1.grafana.net/otlp
13
+ */
14
+ endpoint: string;
15
+ /**
16
+ * OTLP authentication headers.
17
+ * From the same Configure tile; usually Basic auth.
18
+ * Example: "Authorization=Basic%20BASE64_INSTANCE_ID_AND_TOKEN"
19
+ * or object: { Authorization: 'Basic ...' }
20
+ */
21
+ headers?: string | Record<string, string>;
22
+ /**
23
+ * Service name (required).
24
+ * Appears in Tempo, Mimir, and Loki as service_name.
25
+ */
26
+ service: string;
27
+ /**
28
+ * Deployment environment (e.g. 'production', 'staging').
29
+ *
30
+ * @default process.env.NODE_ENV || 'development'
31
+ */
32
+ environment?: string;
33
+ /**
34
+ * Service version for deployment tracking.
35
+ *
36
+ * @default process.env.OTEL_SERVICE_VERSION
37
+ */
38
+ version?: string;
39
+ /**
40
+ * Enable log export to Grafana Cloud (Loki) via OTLP.
41
+ * When true, configures logRecordProcessors so OTel Logs API records are exported.
42
+ *
43
+ * @default true
44
+ */
45
+ enableLogs?: boolean;
46
+ /**
47
+ * Custom log record processors (advanced).
48
+ * Overrides the default OTLP log processor when enableLogs is true.
49
+ */
50
+ logRecordProcessors?: LogRecordProcessor[];
73
51
  }
74
52
  /**
75
53
  * Create an autotel configuration for Grafana Cloud OTLP.
@@ -82,5 +60,6 @@ interface GrafanaPresetConfig {
82
60
  * @returns AutotelConfig ready to pass to init()
83
61
  */
84
62
  declare function createGrafanaConfig(config: GrafanaPresetConfig): AutotelConfig;
85
-
86
- export { type GrafanaPresetConfig, createGrafanaConfig };
63
+ //#endregion
64
+ export { GrafanaPresetConfig, createGrafanaConfig };
65
+ //# sourceMappingURL=grafana.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grafana.d.ts","names":[],"sources":["../src/grafana.ts"],"mappings":";;;;;;;UAkCiB,mBAAA;;;;;;EAMf,QAAA;;;;;;;EAQA,OAAA,YAAmB,MAAA;;;;;EAMnB,OAAA;;;;;;EAOA,WAAA;;;;;;EAOA,OAAA;;;;;;;EAQA,UAAA;;;;;EAMA,mBAAA,GAAsB,kBAAkB;AAAA;;;;;;;;;;;iBA8B1B,mBAAA,CACd,MAAA,EAAQ,mBAAA,GACP,aAAa"}
package/dist/grafana.js CHANGED
@@ -1,78 +1,80 @@
1
- import { createRequire } from 'module';
2
-
3
- // src/grafana.ts
1
+ import { createRequire } from "node:module";
2
+ //#region src/grafana.ts
3
+ /**
4
+ * Grafana Cloud preset for autotel
5
+ *
6
+ * Provides a simplified configuration helper for sending traces, metrics,
7
+ * and logs to Grafana Cloud via the OTLP gateway.
8
+ *
9
+ * Get your endpoint and headers from:
10
+ * Grafana Cloud Portal → your stack → Connections → OpenTelemetry → Configure
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * import { init } from 'autotel';
15
+ * import { createGrafanaConfig } from 'autotel-backends/grafana';
16
+ *
17
+ * init(createGrafanaConfig({
18
+ * endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT!,
19
+ * headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
20
+ * service: 'my-app',
21
+ * enableLogs: true,
22
+ * }));
23
+ * ```
24
+ */
4
25
  function normalizeHeaders(headers) {
5
- if (!headers) return void 0;
6
- if (typeof headers === "object") return headers;
7
- const out = {};
8
- for (const pair of headers.split(",")) {
9
- const [key, ...valueParts] = pair.split("=");
10
- if (key && valueParts.length > 0) {
11
- let value = valueParts.join("=").trim();
12
- value = value.replaceAll("%20", " ");
13
- out[key.trim()] = value;
14
- }
15
- }
16
- return Object.keys(out).length > 0 ? out : void 0;
26
+ if (!headers) return void 0;
27
+ if (typeof headers === "object") return headers;
28
+ const out = {};
29
+ for (const pair of headers.split(",")) {
30
+ const [key, ...valueParts] = pair.split("=");
31
+ if (key && valueParts.length > 0) {
32
+ let value = valueParts.join("=").trim();
33
+ value = value.replaceAll("%20", " ");
34
+ out[key.trim()] = value;
35
+ }
36
+ }
37
+ return Object.keys(out).length > 0 ? out : void 0;
17
38
  }
39
+ /**
40
+ * Create an autotel configuration for Grafana Cloud OTLP.
41
+ *
42
+ * Sends traces (Tempo), metrics (Mimir), and optionally logs (Loki) to the
43
+ * Grafana Cloud OTLP gateway. Endpoint and headers come from the stack's
44
+ * Connections → OpenTelemetry → Configure tile.
45
+ *
46
+ * @param config - Grafana Cloud configuration options
47
+ * @returns AutotelConfig ready to pass to init()
48
+ */
18
49
  function createGrafanaConfig(config) {
19
- const {
20
- endpoint,
21
- headers: headersInput,
22
- service,
23
- environment,
24
- version,
25
- enableLogs = true,
26
- logRecordProcessors
27
- } = config;
28
- if (!endpoint) {
29
- throw new Error(
30
- "Grafana Cloud endpoint is required. Get it from: Grafana Cloud \u2192 your stack \u2192 Connections \u2192 OpenTelemetry \u2192 Configure"
31
- );
32
- }
33
- const headers = normalizeHeaders(headersInput);
34
- const base = endpoint.replace(/\/v1\/(traces|metrics|logs)$/, "");
35
- const logsUrl = `${base}${base.endsWith("/") ? "" : "/"}v1/logs`;
36
- const result = {
37
- service,
38
- environment,
39
- version,
40
- endpoint,
41
- headers,
42
- metrics: true
43
- };
44
- if (enableLogs) {
45
- if (logRecordProcessors) {
46
- result.logRecordProcessors = logRecordProcessors;
47
- } else {
48
- try {
49
- const pkgRequire = createRequire(
50
- typeof __filename === "string" ? __filename : import.meta.url
51
- );
52
- const { BatchLogRecordProcessor } = pkgRequire(
53
- "@opentelemetry/sdk-logs"
54
- );
55
- const { OTLPLogExporter } = pkgRequire(
56
- "@opentelemetry/exporter-logs-otlp-http"
57
- );
58
- result.logRecordProcessors = [
59
- new BatchLogRecordProcessor(
60
- new OTLPLogExporter({
61
- url: logsUrl,
62
- headers
63
- })
64
- )
65
- ];
66
- } catch {
67
- throw new Error(
68
- "Log export requires @opentelemetry/sdk-logs and @opentelemetry/exporter-logs-otlp-http. Install them or set enableLogs: false."
69
- );
70
- }
71
- }
72
- }
73
- return result;
50
+ const { endpoint, headers: headersInput, service, environment, version, enableLogs = true, logRecordProcessors } = config;
51
+ if (!endpoint) throw new Error("Grafana Cloud endpoint is required. Get it from: Grafana Cloud → your stack → Connections → OpenTelemetry → Configure");
52
+ const headers = normalizeHeaders(headersInput);
53
+ const base = endpoint.replace(/\/v1\/(traces|metrics|logs)$/, "");
54
+ const logsUrl = `${base}${base.endsWith("/") ? "" : "/"}v1/logs`;
55
+ const result = {
56
+ service,
57
+ environment,
58
+ version,
59
+ endpoint,
60
+ headers,
61
+ metrics: true
62
+ };
63
+ if (enableLogs) if (logRecordProcessors) result.logRecordProcessors = logRecordProcessors;
64
+ else try {
65
+ const pkgRequire = createRequire(typeof __filename === "string" ? __filename : import.meta.url);
66
+ const { BatchLogRecordProcessor } = pkgRequire("@opentelemetry/sdk-logs");
67
+ const { OTLPLogExporter } = pkgRequire("@opentelemetry/exporter-logs-otlp-http");
68
+ result.logRecordProcessors = [new BatchLogRecordProcessor(new OTLPLogExporter({
69
+ url: logsUrl,
70
+ headers
71
+ }))];
72
+ } catch {
73
+ throw new Error("Log export requires @opentelemetry/sdk-logs and @opentelemetry/exporter-logs-otlp-http. Install them or set enableLogs: false.");
74
+ }
75
+ return result;
74
76
  }
75
-
77
+ //#endregion
76
78
  export { createGrafanaConfig };
77
- //# sourceMappingURL=grafana.js.map
79
+
78
80
  //# sourceMappingURL=grafana.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/grafana.ts"],"names":[],"mappings":";;;AAqFA,SAAS,iBACP,OAAA,EACoC;AACpC,EAAA,IAAI,CAAC,SAAS,OAAO,MAAA;AACrB,EAAA,IAAI,OAAO,OAAA,KAAY,QAAA,EAAU,OAAO,OAAA;AACxC,EAAA,MAAM,MAA8B,EAAC;AACrC,EAAA,KAAA,MAAW,IAAA,IAAQ,OAAA,CAAQ,KAAA,CAAM,GAAG,CAAA,EAAG;AACrC,IAAA,MAAM,CAAC,GAAA,EAAK,GAAG,UAAU,CAAA,GAAI,IAAA,CAAK,MAAM,GAAG,CAAA;AAC3C,IAAA,IAAI,GAAA,IAAO,UAAA,CAAW,MAAA,GAAS,CAAA,EAAG;AAChC,MAAA,IAAI,KAAA,GAAQ,UAAA,CAAW,IAAA,CAAK,GAAG,EAAE,IAAA,EAAK;AACtC,MAAA,KAAA,GAAQ,KAAA,CAAM,UAAA,CAAW,KAAA,EAAO,GAAG,CAAA;AACnC,MAAA,GAAA,CAAI,GAAA,CAAI,IAAA,EAAM,CAAA,GAAI,KAAA;AAAA,IACpB;AAAA,EACF;AACA,EAAA,OAAO,OAAO,IAAA,CAAK,GAAG,CAAA,CAAE,MAAA,GAAS,IAAI,GAAA,GAAM,MAAA;AAC7C;AAYO,SAAS,oBACd,MAAA,EACe;AACf,EAAA,MAAM;AAAA,IACJ,QAAA;AAAA,IACA,OAAA,EAAS,YAAA;AAAA,IACT,OAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA,GAAa,IAAA;AAAA,IACb;AAAA,GACF,GAAI,MAAA;AAEJ,EAAA,IAAI,CAAC,QAAA,EAAU;AACb,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AAEA,EAAA,MAAM,OAAA,GAAU,iBAAiB,YAAY,CAAA;AAC7C,EAAA,MAAM,IAAA,GAAO,QAAA,CAAS,OAAA,CAAQ,8BAAA,EAAgC,EAAE,CAAA;AAChE,EAAA,MAAM,OAAA,GAAU,GAAG,IAAI,CAAA,EAAG,KAAK,QAAA,CAAS,GAAG,CAAA,GAAI,EAAA,GAAK,GAAG,CAAA,OAAA,CAAA;AAEvD,EAAA,MAAM,MAAA,GAAwB;AAAA,IAC5B,OAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAEA,EAAA,IAAI,UAAA,EAAY;AACd,IAAA,IAAI,mBAAA,EAAqB;AACvB,MAAA,MAAA,CAAO,mBAAA,GAAsB,mBAAA;AAAA,IAC/B,CAAA,MAAO;AACL,MAAA,IAAI;AACF,QAAA,MAAM,UAAA,GAAa,aAAA;AAAA,UACjB,OAAO,UAAA,KAAe,QAAA,GAAW,UAAA,GAAa,MAAA,CAAA,IAAA,CAAY;AAAA,SAC5D;AACA,QAAA,MAAM,EAAE,yBAAwB,GAAI,UAAA;AAAA,UAClC;AAAA,SACF;AACA,QAAA,MAAM,EAAE,iBAAgB,GAAI,UAAA;AAAA,UAC1B;AAAA,SACF;AACA,QAAA,MAAA,CAAO,mBAAA,GAAsB;AAAA,UAC3B,IAAI,uBAAA;AAAA,YACF,IAAI,eAAA,CAAgB;AAAA,cAClB,GAAA,EAAK,OAAA;AAAA,cACL;AAAA,aACD;AAAA;AACH,SACF;AAAA,MACF,CAAA,CAAA,MAAQ;AACN,QAAA,MAAM,IAAI,KAAA;AAAA,UACR;AAAA,SAEF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,EAAA,OAAO,MAAA;AACT","file":"grafana.js","sourcesContent":["/**\n * Grafana Cloud preset for autotel\n *\n * Provides a simplified configuration helper for sending traces, metrics,\n * and logs to Grafana Cloud via the OTLP gateway.\n *\n * Get your endpoint and headers from:\n * Grafana Cloud Portal → your stack → Connections → OpenTelemetry → Configure\n *\n * @example\n * ```typescript\n * import { init } from 'autotel';\n * import { createGrafanaConfig } from 'autotel-backends/grafana';\n *\n * init(createGrafanaConfig({\n * endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT!,\n * headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,\n * service: 'my-app',\n * enableLogs: true,\n * }));\n * ```\n */\n\nimport { createRequire } from 'node:module';\nimport type { AutotelConfig } from 'autotel';\nimport type { LogRecordProcessor } from '@opentelemetry/sdk-logs';\n\n// See packages/autotel/src/node-require.ts for why the __filename fallback\n// is necessary alongside import.meta.url.\ndeclare const __filename: string | undefined;\n\n/**\n * Configuration options for Grafana Cloud preset\n */\nexport interface GrafanaPresetConfig {\n /**\n * OTLP gateway endpoint (required).\n * From Grafana Cloud: Stack → Connections → OpenTelemetry → Configure.\n * Example: https://otlp-gateway-prod-gb-south-1.grafana.net/otlp\n */\n endpoint: string;\n\n /**\n * OTLP authentication headers.\n * From the same Configure tile; usually Basic auth.\n * Example: \"Authorization=Basic%20BASE64_INSTANCE_ID_AND_TOKEN\"\n * or object: { Authorization: 'Basic ...' }\n */\n headers?: string | Record<string, string>;\n\n /**\n * Service name (required).\n * Appears in Tempo, Mimir, and Loki as service_name.\n */\n service: string;\n\n /**\n * Deployment environment (e.g. 'production', 'staging').\n *\n * @default process.env.NODE_ENV || 'development'\n */\n environment?: string;\n\n /**\n * Service version for deployment tracking.\n *\n * @default process.env.OTEL_SERVICE_VERSION\n */\n version?: string;\n\n /**\n * Enable log export to Grafana Cloud (Loki) via OTLP.\n * When true, configures logRecordProcessors so OTel Logs API records are exported.\n *\n * @default true\n */\n enableLogs?: boolean;\n\n /**\n * Custom log record processors (advanced).\n * Overrides the default OTLP log processor when enableLogs is true.\n */\n logRecordProcessors?: LogRecordProcessor[];\n}\n\nfunction normalizeHeaders(\n headers: string | Record<string, string> | undefined,\n): Record<string, string> | undefined {\n if (!headers) return undefined;\n if (typeof headers === 'object') return headers;\n const out: Record<string, string> = {};\n for (const pair of headers.split(',')) {\n const [key, ...valueParts] = pair.split('=');\n if (key && valueParts.length > 0) {\n let value = valueParts.join('=').trim();\n value = value.replaceAll('%20', ' ');\n out[key.trim()] = value;\n }\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\n/**\n * Create an autotel configuration for Grafana Cloud OTLP.\n *\n * Sends traces (Tempo), metrics (Mimir), and optionally logs (Loki) to the\n * Grafana Cloud OTLP gateway. Endpoint and headers come from the stack's\n * Connections → OpenTelemetry → Configure tile.\n *\n * @param config - Grafana Cloud configuration options\n * @returns AutotelConfig ready to pass to init()\n */\nexport function createGrafanaConfig(\n config: GrafanaPresetConfig,\n): AutotelConfig {\n const {\n endpoint,\n headers: headersInput,\n service,\n environment,\n version,\n enableLogs = true,\n logRecordProcessors,\n } = config;\n\n if (!endpoint) {\n throw new Error(\n 'Grafana Cloud endpoint is required. Get it from: Grafana Cloud → your stack → Connections → OpenTelemetry → Configure',\n );\n }\n\n const headers = normalizeHeaders(headersInput);\n const base = endpoint.replace(/\\/v1\\/(traces|metrics|logs)$/, '');\n const logsUrl = `${base}${base.endsWith('/') ? '' : '/'}v1/logs`;\n\n const result: AutotelConfig = {\n service,\n environment,\n version,\n endpoint,\n headers,\n metrics: true,\n };\n\n if (enableLogs) {\n if (logRecordProcessors) {\n result.logRecordProcessors = logRecordProcessors;\n } else {\n try {\n const pkgRequire = createRequire(\n typeof __filename === 'string' ? __filename : import.meta.url,\n );\n const { BatchLogRecordProcessor } = pkgRequire(\n '@opentelemetry/sdk-logs',\n );\n const { OTLPLogExporter } = pkgRequire(\n '@opentelemetry/exporter-logs-otlp-http',\n );\n result.logRecordProcessors = [\n new BatchLogRecordProcessor(\n new OTLPLogExporter({\n url: logsUrl,\n headers,\n }),\n ),\n ];\n } catch {\n throw new Error(\n 'Log export requires @opentelemetry/sdk-logs and @opentelemetry/exporter-logs-otlp-http. ' +\n 'Install them or set enableLogs: false.',\n );\n }\n }\n }\n\n return result;\n}\n"]}
1
+ {"version":3,"file":"grafana.js","names":[],"sources":["../src/grafana.ts"],"sourcesContent":["/**\n * Grafana Cloud preset for autotel\n *\n * Provides a simplified configuration helper for sending traces, metrics,\n * and logs to Grafana Cloud via the OTLP gateway.\n *\n * Get your endpoint and headers from:\n * Grafana Cloud Portal → your stack → Connections → OpenTelemetry → Configure\n *\n * @example\n * ```typescript\n * import { init } from 'autotel';\n * import { createGrafanaConfig } from 'autotel-backends/grafana';\n *\n * init(createGrafanaConfig({\n * endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT!,\n * headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,\n * service: 'my-app',\n * enableLogs: true,\n * }));\n * ```\n */\n\nimport { createRequire } from 'node:module';\nimport type { AutotelConfig } from 'autotel';\nimport type { LogRecordProcessor } from '@opentelemetry/sdk-logs';\n\n// See packages/autotel/src/node-require.ts for why the __filename fallback\n// is necessary alongside import.meta.url.\ndeclare const __filename: string | undefined;\n\n/**\n * Configuration options for Grafana Cloud preset\n */\nexport interface GrafanaPresetConfig {\n /**\n * OTLP gateway endpoint (required).\n * From Grafana Cloud: Stack → Connections → OpenTelemetry → Configure.\n * Example: https://otlp-gateway-prod-gb-south-1.grafana.net/otlp\n */\n endpoint: string;\n\n /**\n * OTLP authentication headers.\n * From the same Configure tile; usually Basic auth.\n * Example: \"Authorization=Basic%20BASE64_INSTANCE_ID_AND_TOKEN\"\n * or object: { Authorization: 'Basic ...' }\n */\n headers?: string | Record<string, string>;\n\n /**\n * Service name (required).\n * Appears in Tempo, Mimir, and Loki as service_name.\n */\n service: string;\n\n /**\n * Deployment environment (e.g. 'production', 'staging').\n *\n * @default process.env.NODE_ENV || 'development'\n */\n environment?: string;\n\n /**\n * Service version for deployment tracking.\n *\n * @default process.env.OTEL_SERVICE_VERSION\n */\n version?: string;\n\n /**\n * Enable log export to Grafana Cloud (Loki) via OTLP.\n * When true, configures logRecordProcessors so OTel Logs API records are exported.\n *\n * @default true\n */\n enableLogs?: boolean;\n\n /**\n * Custom log record processors (advanced).\n * Overrides the default OTLP log processor when enableLogs is true.\n */\n logRecordProcessors?: LogRecordProcessor[];\n}\n\nfunction normalizeHeaders(\n headers: string | Record<string, string> | undefined,\n): Record<string, string> | undefined {\n if (!headers) return undefined;\n if (typeof headers === 'object') return headers;\n const out: Record<string, string> = {};\n for (const pair of headers.split(',')) {\n const [key, ...valueParts] = pair.split('=');\n if (key && valueParts.length > 0) {\n let value = valueParts.join('=').trim();\n value = value.replaceAll('%20', ' ');\n out[key.trim()] = value;\n }\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\n/**\n * Create an autotel configuration for Grafana Cloud OTLP.\n *\n * Sends traces (Tempo), metrics (Mimir), and optionally logs (Loki) to the\n * Grafana Cloud OTLP gateway. Endpoint and headers come from the stack's\n * Connections → OpenTelemetry → Configure tile.\n *\n * @param config - Grafana Cloud configuration options\n * @returns AutotelConfig ready to pass to init()\n */\nexport function createGrafanaConfig(\n config: GrafanaPresetConfig,\n): AutotelConfig {\n const {\n endpoint,\n headers: headersInput,\n service,\n environment,\n version,\n enableLogs = true,\n logRecordProcessors,\n } = config;\n\n if (!endpoint) {\n throw new Error(\n 'Grafana Cloud endpoint is required. Get it from: Grafana Cloud → your stack → Connections → OpenTelemetry → Configure',\n );\n }\n\n const headers = normalizeHeaders(headersInput);\n const base = endpoint.replace(/\\/v1\\/(traces|metrics|logs)$/, '');\n const logsUrl = `${base}${base.endsWith('/') ? '' : '/'}v1/logs`;\n\n const result: AutotelConfig = {\n service,\n environment,\n version,\n endpoint,\n headers,\n metrics: true,\n };\n\n if (enableLogs) {\n if (logRecordProcessors) {\n result.logRecordProcessors = logRecordProcessors;\n } else {\n try {\n const pkgRequire = createRequire(\n typeof __filename === 'string' ? __filename : import.meta.url,\n );\n const { BatchLogRecordProcessor } = pkgRequire(\n '@opentelemetry/sdk-logs',\n );\n const { OTLPLogExporter } = pkgRequire(\n '@opentelemetry/exporter-logs-otlp-http',\n );\n result.logRecordProcessors = [\n new BatchLogRecordProcessor(\n new OTLPLogExporter({\n url: logsUrl,\n headers,\n }),\n ),\n ];\n } catch {\n throw new Error(\n 'Log export requires @opentelemetry/sdk-logs and @opentelemetry/exporter-logs-otlp-http. ' +\n 'Install them or set enableLogs: false.',\n );\n }\n }\n }\n\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAqFA,SAAS,iBACP,SACoC;CACpC,IAAI,CAAC,SAAS,OAAO,KAAA;CACrB,IAAI,OAAO,YAAY,UAAU,OAAO;CACxC,MAAM,MAA8B,CAAC;CACrC,KAAK,MAAM,QAAQ,QAAQ,MAAM,GAAG,GAAG;EACrC,MAAM,CAAC,KAAK,GAAG,cAAc,KAAK,MAAM,GAAG;EAC3C,IAAI,OAAO,WAAW,SAAS,GAAG;GAChC,IAAI,QAAQ,WAAW,KAAK,GAAG,CAAC,CAAC,KAAK;GACtC,QAAQ,MAAM,WAAW,OAAO,GAAG;GACnC,IAAI,IAAI,KAAK,KAAK;EACpB;CACF;CACA,OAAO,OAAO,KAAK,GAAG,CAAC,CAAC,SAAS,IAAI,MAAM,KAAA;AAC7C;;;;;;;;;;;AAYA,SAAgB,oBACd,QACe;CACf,MAAM,EACJ,UACA,SAAS,cACT,SACA,aACA,SACA,aAAa,MACb,wBACE;CAEJ,IAAI,CAAC,UACH,MAAM,IAAI,MACR,uHACF;CAGF,MAAM,UAAU,iBAAiB,YAAY;CAC7C,MAAM,OAAO,SAAS,QAAQ,gCAAgC,EAAE;CAChE,MAAM,UAAU,GAAG,OAAO,KAAK,SAAS,GAAG,IAAI,KAAK,IAAI;CAExD,MAAM,SAAwB;EAC5B;EACA;EACA;EACA;EACA;EACA,SAAS;CACX;CAEA,IAAI,YACF,IAAI,qBACF,OAAO,sBAAsB;MAE7B,IAAI;EACF,MAAM,aAAa,cACjB,OAAO,eAAe,WAAW,aAAa,OAAO,KAAK,GAC5D;EACA,MAAM,EAAE,4BAA4B,WAClC,yBACF;EACA,MAAM,EAAE,oBAAoB,WAC1B,wCACF;EACA,OAAO,sBAAsB,CAC3B,IAAI,wBACF,IAAI,gBAAgB;GAClB,KAAK;GACL;EACF,CAAC,CACH,CACF;CACF,QAAQ;EACN,MAAM,IAAI,MACR,gIAEF;CACF;CAIJ,OAAO;AACT"}
@@ -1,41 +1,64 @@
1
- 'use strict';
2
-
3
- // src/honeycomb.ts
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/honeycomb.ts
3
+ /**
4
+ * Create an autotel configuration optimized for Honeycomb.
5
+ *
6
+ * This preset handles:
7
+ * - gRPC protocol configuration (Honeycomb's preferred protocol)
8
+ * - Proper endpoint and authentication headers
9
+ * - Dataset routing (for classic accounts)
10
+ * - Unified service tagging (service, env, version)
11
+ *
12
+ * Honeycomb uses gRPC by default for better performance and lower overhead.
13
+ * This preset automatically configures the gRPC protocol.
14
+ *
15
+ * @param config - Honeycomb-specific configuration options
16
+ * @returns AutotelConfig ready to pass to init()
17
+ *
18
+ * @example Simple configuration
19
+ * ```typescript
20
+ * init(createHoneycombConfig({
21
+ * apiKey: process.env.HONEYCOMB_API_KEY!,
22
+ * service: 'my-app',
23
+ * }));
24
+ * ```
25
+ *
26
+ * @example With custom dataset and environment
27
+ * ```typescript
28
+ * init(createHoneycombConfig({
29
+ * apiKey: process.env.HONEYCOMB_API_KEY!,
30
+ * service: 'my-app',
31
+ * dataset: 'production',
32
+ * environment: 'production',
33
+ * version: '2.1.0',
34
+ * }));
35
+ * ```
36
+ *
37
+ * @example With sample rate
38
+ * ```typescript
39
+ * init(createHoneycombConfig({
40
+ * apiKey: process.env.HONEYCOMB_API_KEY!,
41
+ * service: 'my-app',
42
+ * sampleRate: 10, // Sample 10% of traces (head-based sampling)
43
+ * }));
44
+ * ```
45
+ */
4
46
  function createHoneycombConfig(config) {
5
- const {
6
- apiKey,
7
- service,
8
- dataset,
9
- environment,
10
- version,
11
- endpoint = "api.honeycomb.io:443",
12
- sampleRate
13
- } = config;
14
- if (!apiKey) {
15
- throw new Error(
16
- "Honeycomb API key is required. Get your API key from: https://ui.honeycomb.io/account"
17
- );
18
- }
19
- const headers = {
20
- "x-honeycomb-team": apiKey
21
- };
22
- if (dataset) {
23
- headers["x-honeycomb-dataset"] = dataset;
24
- }
25
- if (sampleRate !== void 0) {
26
- headers["x-honeycomb-samplerate"] = String(sampleRate);
27
- }
28
- return {
29
- service,
30
- environment,
31
- version,
32
- protocol: "grpc",
33
- // Honeycomb uses gRPC for better performance
34
- endpoint,
35
- headers
36
- };
47
+ const { apiKey, service, dataset, environment, version, endpoint = "api.honeycomb.io:443", sampleRate } = config;
48
+ if (!apiKey) throw new Error("Honeycomb API key is required. Get your API key from: https://ui.honeycomb.io/account");
49
+ const headers = { "x-honeycomb-team": apiKey };
50
+ if (dataset) headers["x-honeycomb-dataset"] = dataset;
51
+ if (sampleRate !== void 0) headers["x-honeycomb-samplerate"] = String(sampleRate);
52
+ return {
53
+ service,
54
+ environment,
55
+ version,
56
+ protocol: "grpc",
57
+ endpoint,
58
+ headers
59
+ };
37
60
  }
38
-
61
+ //#endregion
39
62
  exports.createHoneycombConfig = createHoneycombConfig;
40
- //# sourceMappingURL=honeycomb.cjs.map
63
+
41
64
  //# sourceMappingURL=honeycomb.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/honeycomb.ts"],"names":[],"mappings":";;;AA4IO,SAAS,sBACd,MAAA,EACe;AACf,EAAA,MAAM;AAAA,IACJ,MAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA,GAAW,sBAAA;AAAA,IACX;AAAA,GACF,GAAI,MAAA;AAGJ,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AAGA,EAAA,MAAM,OAAA,GAAkC;AAAA,IACtC,kBAAA,EAAoB;AAAA,GACtB;AAGA,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,OAAA,CAAQ,qBAAqB,CAAA,GAAI,OAAA;AAAA,EACnC;AAGA,EAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,IAAA,OAAA,CAAQ,wBAAwB,CAAA,GAAI,MAAA,CAAO,UAAU,CAAA;AAAA,EACvD;AAEA,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA,EAAU,MAAA;AAAA;AAAA,IACV,QAAA;AAAA,IACA;AAAA,GACF;AACF","file":"honeycomb.cjs","sourcesContent":["/**\n * Honeycomb preset for autotel\n *\n * Provides a simplified configuration helper for Honeycomb integration\n * with best practices built-in.\n *\n * @example Using Honeycomb with API key\n * ```typescript\n * import { init } from 'autotel';\n * import { createHoneycombConfig } from 'autotel-backends/honeycomb';\n *\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * }));\n * ```\n *\n * @example With custom dataset\n * ```typescript\n * import { init } from 'autotel';\n * import { createHoneycombConfig } from 'autotel-backends/honeycomb';\n *\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * dataset: 'production',\n * }));\n * ```\n */\n\nimport type { AutotelConfig } from 'autotel';\n\n/**\n * Configuration options for Honeycomb preset\n */\nexport interface HoneycombPresetConfig {\n /**\n * Honeycomb API key (required).\n *\n * Get your API key from:\n * https://ui.honeycomb.io/account\n *\n * For classic environments, use an environment-specific key.\n * For newer environments, use a team-level API key.\n */\n apiKey: string;\n\n /**\n * Service name (required).\n * Appears as service.name in Honeycomb traces and determines dataset routing.\n */\n service: string;\n\n /**\n * Dataset name (optional).\n * For classic Honeycomb accounts that use datasets.\n * Modern environments route based on service.name instead.\n *\n * @default service name\n */\n dataset?: string;\n\n /**\n * Deployment environment (e.g., 'production', 'staging', 'development').\n * Used for environment filtering in Honeycomb.\n *\n * @default process.env.NODE_ENV || 'development'\n */\n environment?: string;\n\n /**\n * Service version for deployment tracking.\n *\n * @default process.env.VERSION || auto-detected from package.json\n */\n version?: string;\n\n /**\n * Honeycomb API endpoint.\n * Use this to configure for different regions or on-premises installations.\n *\n * @default 'api.honeycomb.io:443'\n */\n endpoint?: string;\n\n /**\n * Sample rate for traces (1 = 100%, 10 = 10%, 100 = 1%).\n * Honeycomb's head-based sampling rate.\n *\n * Note: Autotel uses tail-based sampling by default.\n * This setting applies additional head-based sampling if specified.\n *\n * @default undefined (no head-based sampling, relies on tail sampling)\n */\n sampleRate?: number;\n}\n\n/**\n * Create an autotel configuration optimized for Honeycomb.\n *\n * This preset handles:\n * - gRPC protocol configuration (Honeycomb's preferred protocol)\n * - Proper endpoint and authentication headers\n * - Dataset routing (for classic accounts)\n * - Unified service tagging (service, env, version)\n *\n * Honeycomb uses gRPC by default for better performance and lower overhead.\n * This preset automatically configures the gRPC protocol.\n *\n * @param config - Honeycomb-specific configuration options\n * @returns AutotelConfig ready to pass to init()\n *\n * @example Simple configuration\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * }));\n * ```\n *\n * @example With custom dataset and environment\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * dataset: 'production',\n * environment: 'production',\n * version: '2.1.0',\n * }));\n * ```\n *\n * @example With sample rate\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * sampleRate: 10, // Sample 10% of traces (head-based sampling)\n * }));\n * ```\n */\nexport function createHoneycombConfig(\n config: HoneycombPresetConfig,\n): AutotelConfig {\n const {\n apiKey,\n service,\n dataset,\n environment,\n version,\n endpoint = 'api.honeycomb.io:443',\n sampleRate,\n } = config;\n\n // Validation: API key is required\n if (!apiKey) {\n throw new Error(\n 'Honeycomb API key is required. Get your API key from: https://ui.honeycomb.io/account',\n );\n }\n\n // Build headers\n const headers: Record<string, string> = {\n 'x-honeycomb-team': apiKey,\n };\n\n // Add dataset header if specified (for classic Honeycomb accounts)\n if (dataset) {\n headers['x-honeycomb-dataset'] = dataset;\n }\n\n // Add sample rate header if specified\n if (sampleRate !== undefined) {\n headers['x-honeycomb-samplerate'] = String(sampleRate);\n }\n\n return {\n service,\n environment,\n version,\n protocol: 'grpc', // Honeycomb uses gRPC for better performance\n endpoint,\n headers,\n };\n}\n"]}
1
+ {"version":3,"file":"honeycomb.cjs","names":[],"sources":["../src/honeycomb.ts"],"sourcesContent":["/**\n * Honeycomb preset for autotel\n *\n * Provides a simplified configuration helper for Honeycomb integration\n * with best practices built-in.\n *\n * @example Using Honeycomb with API key\n * ```typescript\n * import { init } from 'autotel';\n * import { createHoneycombConfig } from 'autotel-backends/honeycomb';\n *\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * }));\n * ```\n *\n * @example With custom dataset\n * ```typescript\n * import { init } from 'autotel';\n * import { createHoneycombConfig } from 'autotel-backends/honeycomb';\n *\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * dataset: 'production',\n * }));\n * ```\n */\n\nimport type { AutotelConfig } from 'autotel';\n\n/**\n * Configuration options for Honeycomb preset\n */\nexport interface HoneycombPresetConfig {\n /**\n * Honeycomb API key (required).\n *\n * Get your API key from:\n * https://ui.honeycomb.io/account\n *\n * For classic environments, use an environment-specific key.\n * For newer environments, use a team-level API key.\n */\n apiKey: string;\n\n /**\n * Service name (required).\n * Appears as service.name in Honeycomb traces and determines dataset routing.\n */\n service: string;\n\n /**\n * Dataset name (optional).\n * For classic Honeycomb accounts that use datasets.\n * Modern environments route based on service.name instead.\n *\n * @default service name\n */\n dataset?: string;\n\n /**\n * Deployment environment (e.g., 'production', 'staging', 'development').\n * Used for environment filtering in Honeycomb.\n *\n * @default process.env.NODE_ENV || 'development'\n */\n environment?: string;\n\n /**\n * Service version for deployment tracking.\n *\n * @default process.env.VERSION || auto-detected from package.json\n */\n version?: string;\n\n /**\n * Honeycomb API endpoint.\n * Use this to configure for different regions or on-premises installations.\n *\n * @default 'api.honeycomb.io:443'\n */\n endpoint?: string;\n\n /**\n * Sample rate for traces (1 = 100%, 10 = 10%, 100 = 1%).\n * Honeycomb's head-based sampling rate.\n *\n * Note: Autotel uses tail-based sampling by default.\n * This setting applies additional head-based sampling if specified.\n *\n * @default undefined (no head-based sampling, relies on tail sampling)\n */\n sampleRate?: number;\n}\n\n/**\n * Create an autotel configuration optimized for Honeycomb.\n *\n * This preset handles:\n * - gRPC protocol configuration (Honeycomb's preferred protocol)\n * - Proper endpoint and authentication headers\n * - Dataset routing (for classic accounts)\n * - Unified service tagging (service, env, version)\n *\n * Honeycomb uses gRPC by default for better performance and lower overhead.\n * This preset automatically configures the gRPC protocol.\n *\n * @param config - Honeycomb-specific configuration options\n * @returns AutotelConfig ready to pass to init()\n *\n * @example Simple configuration\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * }));\n * ```\n *\n * @example With custom dataset and environment\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * dataset: 'production',\n * environment: 'production',\n * version: '2.1.0',\n * }));\n * ```\n *\n * @example With sample rate\n * ```typescript\n * init(createHoneycombConfig({\n * apiKey: process.env.HONEYCOMB_API_KEY!,\n * service: 'my-app',\n * sampleRate: 10, // Sample 10% of traces (head-based sampling)\n * }));\n * ```\n */\nexport function createHoneycombConfig(\n config: HoneycombPresetConfig,\n): AutotelConfig {\n const {\n apiKey,\n service,\n dataset,\n environment,\n version,\n endpoint = 'api.honeycomb.io:443',\n sampleRate,\n } = config;\n\n // Validation: API key is required\n if (!apiKey) {\n throw new Error(\n 'Honeycomb API key is required. Get your API key from: https://ui.honeycomb.io/account',\n );\n }\n\n // Build headers\n const headers: Record<string, string> = {\n 'x-honeycomb-team': apiKey,\n };\n\n // Add dataset header if specified (for classic Honeycomb accounts)\n if (dataset) {\n headers['x-honeycomb-dataset'] = dataset;\n }\n\n // Add sample rate header if specified\n if (sampleRate !== undefined) {\n headers['x-honeycomb-samplerate'] = String(sampleRate);\n }\n\n return {\n service,\n environment,\n version,\n protocol: 'grpc', // Honeycomb uses gRPC for better performance\n endpoint,\n headers,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4IA,SAAgB,sBACd,QACe;CACf,MAAM,EACJ,QACA,SACA,SACA,aACA,SACA,WAAW,wBACX,eACE;CAGJ,IAAI,CAAC,QACH,MAAM,IAAI,MACR,uFACF;CAIF,MAAM,UAAkC,EACtC,oBAAoB,OACtB;CAGA,IAAI,SACF,QAAQ,yBAAyB;CAInC,IAAI,eAAe,KAAA,GACjB,QAAQ,4BAA4B,OAAO,UAAU;CAGvD,OAAO;EACL;EACA;EACA;EACA,UAAU;EACV;EACA;CACF;AACF"}
@@ -1,92 +1,63 @@
1
- import { AutotelConfig } from 'autotel';
2
-
3
- /**
4
- * Honeycomb preset for autotel
5
- *
6
- * Provides a simplified configuration helper for Honeycomb integration
7
- * with best practices built-in.
8
- *
9
- * @example Using Honeycomb with API key
10
- * ```typescript
11
- * import { init } from 'autotel';
12
- * import { createHoneycombConfig } from 'autotel-backends/honeycomb';
13
- *
14
- * init(createHoneycombConfig({
15
- * apiKey: process.env.HONEYCOMB_API_KEY!,
16
- * service: 'my-app',
17
- * }));
18
- * ```
19
- *
20
- * @example With custom dataset
21
- * ```typescript
22
- * import { init } from 'autotel';
23
- * import { createHoneycombConfig } from 'autotel-backends/honeycomb';
24
- *
25
- * init(createHoneycombConfig({
26
- * apiKey: process.env.HONEYCOMB_API_KEY!,
27
- * service: 'my-app',
28
- * dataset: 'production',
29
- * }));
30
- * ```
31
- */
1
+ import { AutotelConfig } from "autotel";
32
2
 
3
+ //#region src/honeycomb.d.ts
33
4
  /**
34
5
  * Configuration options for Honeycomb preset
35
6
  */
36
7
  interface HoneycombPresetConfig {
37
- /**
38
- * Honeycomb API key (required).
39
- *
40
- * Get your API key from:
41
- * https://ui.honeycomb.io/account
42
- *
43
- * For classic environments, use an environment-specific key.
44
- * For newer environments, use a team-level API key.
45
- */
46
- apiKey: string;
47
- /**
48
- * Service name (required).
49
- * Appears as service.name in Honeycomb traces and determines dataset routing.
50
- */
51
- service: string;
52
- /**
53
- * Dataset name (optional).
54
- * For classic Honeycomb accounts that use datasets.
55
- * Modern environments route based on service.name instead.
56
- *
57
- * @default service name
58
- */
59
- dataset?: string;
60
- /**
61
- * Deployment environment (e.g., 'production', 'staging', 'development').
62
- * Used for environment filtering in Honeycomb.
63
- *
64
- * @default process.env.NODE_ENV || 'development'
65
- */
66
- environment?: string;
67
- /**
68
- * Service version for deployment tracking.
69
- *
70
- * @default process.env.VERSION || auto-detected from package.json
71
- */
72
- version?: string;
73
- /**
74
- * Honeycomb API endpoint.
75
- * Use this to configure for different regions or on-premises installations.
76
- *
77
- * @default 'api.honeycomb.io:443'
78
- */
79
- endpoint?: string;
80
- /**
81
- * Sample rate for traces (1 = 100%, 10 = 10%, 100 = 1%).
82
- * Honeycomb's head-based sampling rate.
83
- *
84
- * Note: Autotel uses tail-based sampling by default.
85
- * This setting applies additional head-based sampling if specified.
86
- *
87
- * @default undefined (no head-based sampling, relies on tail sampling)
88
- */
89
- sampleRate?: number;
8
+ /**
9
+ * Honeycomb API key (required).
10
+ *
11
+ * Get your API key from:
12
+ * https://ui.honeycomb.io/account
13
+ *
14
+ * For classic environments, use an environment-specific key.
15
+ * For newer environments, use a team-level API key.
16
+ */
17
+ apiKey: string;
18
+ /**
19
+ * Service name (required).
20
+ * Appears as service.name in Honeycomb traces and determines dataset routing.
21
+ */
22
+ service: string;
23
+ /**
24
+ * Dataset name (optional).
25
+ * For classic Honeycomb accounts that use datasets.
26
+ * Modern environments route based on service.name instead.
27
+ *
28
+ * @default service name
29
+ */
30
+ dataset?: string;
31
+ /**
32
+ * Deployment environment (e.g., 'production', 'staging', 'development').
33
+ * Used for environment filtering in Honeycomb.
34
+ *
35
+ * @default process.env.NODE_ENV || 'development'
36
+ */
37
+ environment?: string;
38
+ /**
39
+ * Service version for deployment tracking.
40
+ *
41
+ * @default process.env.VERSION || auto-detected from package.json
42
+ */
43
+ version?: string;
44
+ /**
45
+ * Honeycomb API endpoint.
46
+ * Use this to configure for different regions or on-premises installations.
47
+ *
48
+ * @default 'api.honeycomb.io:443'
49
+ */
50
+ endpoint?: string;
51
+ /**
52
+ * Sample rate for traces (1 = 100%, 10 = 10%, 100 = 1%).
53
+ * Honeycomb's head-based sampling rate.
54
+ *
55
+ * Note: Autotel uses tail-based sampling by default.
56
+ * This setting applies additional head-based sampling if specified.
57
+ *
58
+ * @default undefined (no head-based sampling, relies on tail sampling)
59
+ */
60
+ sampleRate?: number;
90
61
  }
91
62
  /**
92
63
  * Create an autotel configuration optimized for Honeycomb.
@@ -132,5 +103,6 @@ interface HoneycombPresetConfig {
132
103
  * ```
133
104
  */
134
105
  declare function createHoneycombConfig(config: HoneycombPresetConfig): AutotelConfig;
135
-
136
- export { type HoneycombPresetConfig, createHoneycombConfig };
106
+ //#endregion
107
+ export { HoneycombPresetConfig, createHoneycombConfig };
108
+ //# sourceMappingURL=honeycomb.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"honeycomb.d.cts","names":[],"sources":["../src/honeycomb.ts"],"mappings":";;;;;;UAmCiB,qBAAA;;;;;;;;;;EAUf,MAAA;;;;;EAMA,OAAA;;;;;;;;EASA,OAAA;;;;;;;EAQA,WAAA;;;;;;EAOA,OAAA;;;;;;;EAQA,QAAA;;;;;;;;;;EAWA,UAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Cc,qBAAA,CACd,MAAA,EAAQ,qBAAA,GACP,aAAa"}