mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
feat: bump deps (#14076)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Updated core dependencies, developer tooling and Rust toolchain to
newer stable versions across the repo
* Upgraded Storybook to v10 and improved ESM path resolution for
storybook tooling
* Broadened native binding platform/architecture support and
strengthened native module version validation, loading and WASI handling
* **New Features**
* Exposed an additional native text export for consumers (enhanced
JS/native surface)
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -13,8 +13,8 @@ import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
|
||||
import { IORedisInstrumentation } from '@opentelemetry/instrumentation-ioredis';
|
||||
import { NestInstrumentation } from '@opentelemetry/instrumentation-nestjs-core';
|
||||
import { SocketIoInstrumentation } from '@opentelemetry/instrumentation-socket.io';
|
||||
import { Resource } from '@opentelemetry/resources';
|
||||
import { MetricProducer, MetricReader } from '@opentelemetry/sdk-metrics';
|
||||
import { resourceFromAttributes } from '@opentelemetry/resources';
|
||||
import { IMetricReader, MetricProducer } from '@opentelemetry/sdk-metrics';
|
||||
import { NodeSDK, NodeSDKConfiguration } from '@opentelemetry/sdk-node';
|
||||
import {
|
||||
BatchSpanProcessor,
|
||||
@@ -34,7 +34,7 @@ import { registerCustomMetrics } from './metrics';
|
||||
import { PrismaMetricProducer } from './prisma';
|
||||
|
||||
export abstract class BaseOpentelemetryOptionsFactory {
|
||||
abstract getMetricReader(): MetricReader;
|
||||
abstract getMetricReader(): IMetricReader;
|
||||
abstract getSpanExporter(): SpanExporter;
|
||||
|
||||
getInstractions(): Instrumentation[] {
|
||||
@@ -53,7 +53,7 @@ export abstract class BaseOpentelemetryOptionsFactory {
|
||||
}
|
||||
|
||||
getResource() {
|
||||
return new Resource({
|
||||
return resourceFromAttributes({
|
||||
[ATTR_K8S_NAMESPACE_NAME]: env.NAMESPACE,
|
||||
[ATTR_SERVICE_NAME]: env.FLAVOR,
|
||||
[ATTR_SERVICE_VERSION]: env.version,
|
||||
@@ -82,7 +82,7 @@ export abstract class BaseOpentelemetryOptionsFactory {
|
||||
|
||||
@Injectable()
|
||||
export class OpentelemetryOptionsFactory extends BaseOpentelemetryOptionsFactory {
|
||||
override getMetricReader(): MetricReader {
|
||||
override getMetricReader(): IMetricReader {
|
||||
return new PrometheusExporter({
|
||||
metricProducers: this.getMetricsProducers(),
|
||||
});
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { HrTime, ValueType } from '@opentelemetry/api';
|
||||
import { hrTime } from '@opentelemetry/core';
|
||||
import { Resource } from '@opentelemetry/resources';
|
||||
import { emptyResource } from '@opentelemetry/resources';
|
||||
import {
|
||||
AggregationTemporality,
|
||||
CollectionResult,
|
||||
DataPointType,
|
||||
InstrumentType,
|
||||
MetricProducer,
|
||||
ScopeMetrics,
|
||||
} from '@opentelemetry/sdk-metrics';
|
||||
@@ -24,7 +23,7 @@ export class PrismaMetricProducer implements MetricProducer {
|
||||
async collect(): Promise<CollectionResult> {
|
||||
const result: CollectionResult = {
|
||||
resourceMetrics: {
|
||||
resource: Resource.EMPTY,
|
||||
resource: emptyResource(),
|
||||
scopeMetrics: [],
|
||||
},
|
||||
errors: [],
|
||||
@@ -51,7 +50,6 @@ export class PrismaMetricProducer implements MetricProducer {
|
||||
name: transformPrismaKey(counter.key),
|
||||
description: counter.description,
|
||||
unit: '1',
|
||||
type: InstrumentType.COUNTER,
|
||||
valueType: ValueType.INT,
|
||||
},
|
||||
dataPointType: DataPointType.SUM,
|
||||
@@ -74,7 +72,6 @@ export class PrismaMetricProducer implements MetricProducer {
|
||||
name: transformPrismaKey(gauge.key),
|
||||
description: gauge.description,
|
||||
unit: '1',
|
||||
type: InstrumentType.UP_DOWN_COUNTER,
|
||||
valueType: ValueType.INT,
|
||||
},
|
||||
dataPointType: DataPointType.GAUGE,
|
||||
@@ -102,7 +99,6 @@ export class PrismaMetricProducer implements MetricProducer {
|
||||
name: transformPrismaKey(histogram.key),
|
||||
description: histogram.description,
|
||||
unit: 'ms',
|
||||
type: InstrumentType.HISTOGRAM,
|
||||
valueType: ValueType.DOUBLE,
|
||||
},
|
||||
dataPointType: DataPointType.HISTOGRAM,
|
||||
|
||||
@@ -1,29 +1,35 @@
|
||||
import { TraceExporter } from '@google-cloud/opentelemetry-cloud-trace-exporter';
|
||||
import { GcpDetectorSync } from '@google-cloud/opentelemetry-resource-util';
|
||||
import { Global, Injectable, Module, Provider } from '@nestjs/common';
|
||||
import { getEnv } from '@opentelemetry/core';
|
||||
import { Resource } from '@opentelemetry/resources';
|
||||
import {
|
||||
type Resource,
|
||||
resourceFromAttributes,
|
||||
} from '@opentelemetry/resources';
|
||||
import { SpanExporter } from '@opentelemetry/sdk-trace-node';
|
||||
import {
|
||||
SEMRESATTRS_CONTAINER_NAME,
|
||||
SEMRESATTRS_K8S_POD_NAME,
|
||||
} from '@opentelemetry/semantic-conventions';
|
||||
ATTR_CONTAINER_NAME,
|
||||
ATTR_K8S_POD_NAME,
|
||||
} from '@opentelemetry/semantic-conventions/incubating';
|
||||
|
||||
import { OpentelemetryOptionsFactory } from '../../base/metrics';
|
||||
|
||||
@Injectable()
|
||||
export class GCloudOpentelemetryOptionsFactory extends OpentelemetryOptionsFactory {
|
||||
override getResource(): Resource {
|
||||
const env = getEnv();
|
||||
const envAttrs: Record<string, string> = {};
|
||||
if (process.env.HOSTNAME) {
|
||||
envAttrs[ATTR_K8S_POD_NAME] = process.env.HOSTNAME;
|
||||
}
|
||||
if (process.env.CONTAINER_NAME) {
|
||||
envAttrs[ATTR_CONTAINER_NAME] = process.env.CONTAINER_NAME;
|
||||
}
|
||||
|
||||
const detected = new GcpDetectorSync().detect();
|
||||
|
||||
return super
|
||||
.getResource()
|
||||
.merge(
|
||||
new Resource({
|
||||
[SEMRESATTRS_K8S_POD_NAME]: env.HOSTNAME,
|
||||
[SEMRESATTRS_CONTAINER_NAME]: env.CONTAINER_NAME,
|
||||
})
|
||||
)
|
||||
.merge(new GcpDetectorSync().detect());
|
||||
.merge(resourceFromAttributes(envAttrs))
|
||||
.merge(resourceFromAttributes(detected.attributes ?? {}));
|
||||
}
|
||||
|
||||
override getSpanExporter(): SpanExporter {
|
||||
|
||||
Reference in New Issue
Block a user