@cedarjs/cli 7.0.0-canary.3128 → 7.0.0-canary.3130

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.
@@ -3,12 +3,18 @@ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
3
3
  import { registerInstrumentations } from '@opentelemetry/instrumentation'
4
4
  import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify'
5
5
  import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
6
- import { Resource } from '@opentelemetry/resources'
6
+ import {
7
+ defaultResource,
8
+ resourceFromAttributes,
9
+ } from '@opentelemetry/resources'
7
10
  import {
8
11
  NodeTracerProvider,
9
12
  SimpleSpanProcessor,
10
13
  } from '@opentelemetry/sdk-trace-node'
11
- import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'
14
+ import {
15
+ ATTR_SERVICE_NAME,
16
+ ATTR_SERVICE_VERSION,
17
+ } from '@opentelemetry/semantic-conventions'
12
18
  import { PrismaInstrumentation } from '@prisma/instrumentation'
13
19
 
14
20
  import { getConfig } from '@cedarjs/project-config'
@@ -16,10 +22,10 @@ import { getConfig } from '@cedarjs/project-config'
16
22
  // You may wish to set this to DiagLogLevel.DEBUG when you need to debug opentelemetry itself
17
23
  diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO)
18
24
 
19
- const resource = Resource.default().merge(
20
- new Resource({
21
- [SemanticResourceAttributes.SERVICE_NAME]: 'redwood-app',
22
- [SemanticResourceAttributes.SERVICE_VERSION]: '0.0.0',
25
+ const resource = defaultResource().merge(
26
+ resourceFromAttributes({
27
+ [ATTR_SERVICE_NAME]: 'redwood-app',
28
+ [ATTR_SERVICE_VERSION]: '0.0.0',
23
29
  })
24
30
  )
25
31
 
@@ -38,8 +44,8 @@ const processor = new SimpleSpanProcessor(exporter)
38
44
 
39
45
  const provider = new NodeTracerProvider({
40
46
  resource: resource,
47
+ spanProcessors: [processor],
41
48
  })
42
- provider.addSpanProcessor(processor)
43
49
 
44
50
  // Optionally register instrumentation libraries here
45
51
  registerInstrumentations({
@@ -22,6 +22,8 @@ async function startTelemetry() {
22
22
  isStarted = true;
23
23
  try {
24
24
  diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ERROR);
25
+ traceExporter = new CustomFileExporter();
26
+ traceProcessor = new SimpleSpanProcessor(traceExporter);
25
27
  traceProvider = new NodeTracerProvider({
26
28
  sampler: {
27
29
  shouldSample: () => {
@@ -32,11 +34,9 @@ async function startTelemetry() {
32
34
  toString: () => {
33
35
  return "AlwaysSampleWhenNotShutdown";
34
36
  }
35
- }
37
+ },
38
+ spanProcessors: [traceProcessor]
36
39
  });
37
- traceExporter = new CustomFileExporter();
38
- traceProcessor = new SimpleSpanProcessor(traceExporter);
39
- traceProvider.addSpanProcessor(traceProcessor);
40
40
  traceProvider.register();
41
41
  const cleanArgv = hideBin(process.argv);
42
42
  if (!cleanArgv.includes("sb") && !cleanArgv.includes("storybook")) {
@@ -79,7 +79,7 @@ async function getResources() {
79
79
  "vscode.version": info.IDEs?.VSCode?.version,
80
80
  "cpu.count": cpu.physicalCores,
81
81
  "memory.gb": Math.round(mem.total / 1073741824),
82
- "env.node_env": process.env.NODE_ENV || null,
82
+ "env.node_env": process.env.NODE_ENV || void 0,
83
83
  "ci.redwood": !!process.env.CEDAR_CI,
84
84
  "ci.isci": ci.isCI,
85
85
  "dev.environment": developmentEnvironment,
@@ -2,7 +2,10 @@ import fs from "node:fs";
2
2
  import path from "path";
3
3
  import { ExportResultCode } from "@opentelemetry/core";
4
4
  import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
5
- import { Resource } from "@opentelemetry/resources";
5
+ import {
6
+ defaultResource,
7
+ resourceFromAttributes
8
+ } from "@opentelemetry/resources";
6
9
  import { getPaths } from "@cedarjs/project-config";
7
10
  import { getResources } from "./resource.js";
8
11
  async function main() {
@@ -20,7 +23,9 @@ async function main() {
20
23
  console.time("Computed resource information");
21
24
  const customResourceData = await getResources();
22
25
  console.timeEnd("Computed resource information");
23
- const resource = Resource.default().merge(new Resource(customResourceData));
26
+ const resource = defaultResource().merge(
27
+ resourceFromAttributes(customResourceData)
28
+ );
24
29
  const url = process.env.CEDAR_REDIRECT_TELEMETRY || process.env.REDWOOD_REDIRECT_TELEMETRY || "https://quark.quantumparticle.io/v1/traces";
25
30
  const traceExporter = new OTLPTraceExporter({
26
31
  url
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "7.0.0-canary.3128",
3
+ "version": "7.0.0-canary.3130",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,23 +36,23 @@
36
36
  "@babel/preset-typescript": "7.29.7",
37
37
  "@babel/traverse": "7.29.8",
38
38
  "@babel/types": "7.29.8",
39
- "@cedarjs/api-server": "7.0.0-canary.3128",
40
- "@cedarjs/babel-config": "7.0.0-canary.3128",
41
- "@cedarjs/cli-helpers": "7.0.0-canary.3128",
42
- "@cedarjs/internal": "7.0.0-canary.3128",
43
- "@cedarjs/prerender": "7.0.0-canary.3128",
44
- "@cedarjs/project-config": "7.0.0-canary.3128",
45
- "@cedarjs/structure": "7.0.0-canary.3128",
46
- "@cedarjs/telemetry": "7.0.0-canary.3128",
47
- "@cedarjs/utils": "7.0.0-canary.3128",
48
- "@cedarjs/vite": "7.0.0-canary.3128",
49
- "@cedarjs/web-server": "7.0.0-canary.3128",
39
+ "@cedarjs/api-server": "7.0.0-canary.3130",
40
+ "@cedarjs/babel-config": "7.0.0-canary.3130",
41
+ "@cedarjs/cli-helpers": "7.0.0-canary.3130",
42
+ "@cedarjs/internal": "7.0.0-canary.3130",
43
+ "@cedarjs/prerender": "7.0.0-canary.3130",
44
+ "@cedarjs/project-config": "7.0.0-canary.3130",
45
+ "@cedarjs/structure": "7.0.0-canary.3130",
46
+ "@cedarjs/telemetry": "7.0.0-canary.3130",
47
+ "@cedarjs/utils": "7.0.0-canary.3130",
48
+ "@cedarjs/vite": "7.0.0-canary.3130",
49
+ "@cedarjs/web-server": "7.0.0-canary.3130",
50
50
  "@listr2/prompt-adapter-enquirer": "4.3.2",
51
51
  "@opentelemetry/api": "1.9.1",
52
- "@opentelemetry/core": "1.30.1",
53
- "@opentelemetry/exporter-trace-otlp-http": "0.57.2",
54
- "@opentelemetry/resources": "1.30.1",
55
- "@opentelemetry/sdk-trace-node": "1.30.1",
52
+ "@opentelemetry/core": "2.11.0",
53
+ "@opentelemetry/exporter-trace-otlp-http": "0.222.0",
54
+ "@opentelemetry/resources": "2.11.0",
55
+ "@opentelemetry/sdk-trace-node": "2.11.0",
56
56
  "@opentelemetry/semantic-conventions": "1.41.1",
57
57
  "@prisma/internals": "7.10.0",
58
58
  "ansis": "4.3.1",
@@ -94,7 +94,7 @@
94
94
  "yargs": "17.7.3"
95
95
  },
96
96
  "devDependencies": {
97
- "@cedarjs/framework-tools": "7.0.0-canary.3128",
97
+ "@cedarjs/framework-tools": "7.0.0-canary.3130",
98
98
  "@prisma/dmmf": "7.10.0",
99
99
  "@types/archiver": "^7.0.0",
100
100
  "memfs": "4.68.2",