Compare commits

...

5 Commits

46 changed files with 111 additions and 209 deletions

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.31.4](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.31.3...@standardnotes/analytics@2.31.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/server/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [2.31.3](https://github.com/standardnotes/server/compare/@standardnotes/analytics@2.31.2...@standardnotes/analytics@2.31.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/analytics

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/analytics",
"version": "2.31.3",
"version": "2.31.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -7,7 +7,7 @@ import {
DomainEventPublisherInterface,
DomainEventSubscriberFactoryInterface,
} from '@standardnotes/domain-events'
import { MapperInterface, ServiceIdentifier } from '@standardnotes/domain-core'
import { MapperInterface } from '@standardnotes/domain-core'
// eslint-disable-next-line @typescript-eslint/no-var-requires
const Mixpanel = require('mixpanel')
@@ -16,11 +16,9 @@ import TYPES from './Types'
import { AppDataSource } from './DataSource'
import { DomainEventFactory } from '../Domain/Event/DomainEventFactory'
import {
OpenTelemetryPropagation,
OpenTelemetryPropagationInterface,
SNSOpenTelemetryDomainEventPublisher,
SQSDomainEventSubscriberFactory,
SQSOpenTelemetryEventMessageHandler,
SQSEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { Timer, TimerInterface } from '@standardnotes/time'
import { PeriodKeyGeneratorInterface } from '../Domain/Time/PeriodKeyGeneratorInterface'
@@ -89,10 +87,6 @@ export class ContainerConfigLoader {
})
container.bind<winston.Logger>(TYPES.Logger).toConstantValue(logger)
container
.bind<OpenTelemetryPropagationInterface>(TYPES.OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
const snsConfig: SNSClientConfig = {
apiVersion: 'latest',
region: env.get('SNS_AWS_REGION', true),
@@ -146,11 +140,7 @@ export class ContainerConfigLoader {
container
.bind<DomainEventPublisherInterface>(TYPES.DomainEventPublisher)
.toConstantValue(
new SNSOpenTelemetryDomainEventPublisher(
container.get<OpenTelemetryPropagationInterface>(TYPES.OTEL_PROPAGATOR),
container.get(TYPES.SNS),
container.get(TYPES.SNS_TOPIC_ARN),
),
new SNSOpenTelemetryDomainEventPublisher(container.get(TYPES.SNS), container.get(TYPES.SNS_TOPIC_ARN)),
)
if (env.get('MIXPANEL_TOKEN', true)) {
container.bind<Mixpanel>(TYPES.MixpanelClient).toConstantValue(Mixpanel.init(env.get('MIXPANEL_TOKEN', true)))
@@ -248,14 +238,7 @@ export class ContainerConfigLoader {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.DomainEventMessageHandler)
.toConstantValue(
new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.AnalyticsWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.DomainEventSubscriberFactory)
.toConstantValue(

View File

@@ -3,7 +3,6 @@ const TYPES = {
Redis: Symbol.for('Redis'),
SNS: Symbol.for('SNS'),
SQS: Symbol.for('SQS'),
OTEL_PROPAGATOR: Symbol.for('OTEL_PROPAGATOR'),
// env vars
REDIS_URL: Symbol.for('REDIS_URL'),
SNS_TOPIC_ARN: Symbol.for('SNS_TOPIC_ARN'),

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.79.9](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.79.8...@standardnotes/api-gateway@1.79.9) (2023-10-12)
**Note:** Version bump only for package @standardnotes/api-gateway
## [1.79.8](https://github.com/standardnotes/api-gateway/compare/@standardnotes/api-gateway@1.79.7...@standardnotes/api-gateway@1.79.8) (2023-10-12)
**Note:** Version bump only for package @standardnotes/api-gateway

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/api-gateway",
"version": "1.79.8",
"version": "1.79.9",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.158.4](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.158.3...@standardnotes/auth-server@1.158.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/server/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.158.3](https://github.com/standardnotes/server/compare/@standardnotes/auth-server@1.158.2...@standardnotes/auth-server@1.158.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/auth-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/auth-server",
"version": "1.158.3",
"version": "1.158.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -89,12 +89,9 @@ import { ExtensionKeyGrantedEventHandler } from '../Domain/Handler/ExtensionKeyG
import {
DirectCallDomainEventPublisher,
DirectCallEventMessageHandler,
OpenTelemetryPropagation,
OpenTelemetryPropagationInterface,
SNSOpenTelemetryDomainEventPublisher,
SQSDomainEventSubscriberFactory,
SQSEventMessageHandler,
SQSOpenTelemetryEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { GetUserSubscription } from '../Domain/UseCase/GetUserSubscription/GetUserSubscription'
import { ChangeCredentials } from '../Domain/UseCase/ChangeCredentials/ChangeCredentials'
@@ -191,7 +188,6 @@ import {
ControllerContainer,
ControllerContainerInterface,
MapperInterface,
ServiceIdentifier,
SharedVaultUser,
} from '@standardnotes/domain-core'
import { SessionTracePersistenceMapper } from '../Mapping/SessionTracePersistenceMapper'
@@ -310,10 +306,6 @@ export class ContainerConfigLoader {
}
container.bind<winston.Logger>(TYPES.Auth_Logger).toConstantValue(logger)
container
.bind<OpenTelemetryPropagationInterface>(TYPES.Auth_OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
const appDataSource = new AppDataSource({ env, runMigrations: this.mode === 'server' })
await appDataSource.initialize()
@@ -732,7 +724,6 @@ export class ContainerConfigLoader {
isConfiguredForHomeServer
? directCallDomainEventPublisher
: new SNSOpenTelemetryDomainEventPublisher(
container.get<OpenTelemetryPropagationInterface>(TYPES.Auth_OTEL_PROPAGATOR),
container.get(TYPES.Auth_SNS),
container.get(TYPES.Auth_SNS_TOPIC_ARN),
),
@@ -1233,16 +1224,7 @@ export class ContainerConfigLoader {
} else {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.Auth_DomainEventMessageHandler)
.toConstantValue(
isConfiguredForHomeServerOrSelfHosting
? new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Auth_Logger))
: new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.AuthWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.Auth_OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Auth_Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Auth_Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.Auth_DomainEventSubscriberFactory)

View File

@@ -3,7 +3,6 @@ const TYPES = {
Auth_Redis: Symbol.for('Auth_Redis'),
Auth_SNS: Symbol.for('Auth_SNS'),
Auth_SQS: Symbol.for('Auth_SQS'),
Auth_OTEL_PROPAGATOR: Symbol.for('Auth_OTEL_PROPAGATOR'),
// Mapping
Auth_SessionTracePersistenceMapper: Symbol.for('Auth_SessionTracePersistenceMapper'),
Auth_AuthenticatorChallengePersistenceMapper: Symbol.for('Auth_AuthenticatorChallengePersistenceMapper'),

View File

@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.19.4](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.19.3...@standardnotes/domain-events-infra@1.19.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* **domain-events-infra:** supress typeorm internal instrumentation ([1246af2](https://github.com/standardnotes/server/commit/1246af2551ae3502734583fbc7dcebc91c16eb6b))
* enable opentelemetry tracing on async workers via sqs/sns automation ([0a90502](https://github.com/standardnotes/server/commit/0a90502658ce6f60f4a3100a518d522d6209a8fd))
## [1.19.3](https://github.com/standardnotes/server/compare/@standardnotes/domain-events-infra@1.19.2...@standardnotes/domain-events-infra@1.19.3) (2023-10-12)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events-infra",
"version": "1.19.3",
"version": "1.19.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -1,19 +0,0 @@
import * as OpenTelemetryApi from '@opentelemetry/api'
import { OpenTelemetryPropagationInterface } from './OpenTelemetryPropagationInterface'
export class OpenTelemetryPropagation implements OpenTelemetryPropagationInterface {
inject(): Record<string, string> {
const output = {}
OpenTelemetryApi.propagation.inject(OpenTelemetryApi.context.active(), output)
return output
}
extract(input: Record<string, string>): OpenTelemetryApi.Context {
const activeContext = OpenTelemetryApi.propagation.extract(OpenTelemetryApi.context.active(), input)
return activeContext
}
}

View File

@@ -1,6 +0,0 @@
import { Context } from '@opentelemetry/api'
export interface OpenTelemetryPropagationInterface {
inject(): Record<string, string>
extract(input: Record<string, string>): Context
}

View File

@@ -60,8 +60,12 @@ export class OpenTelemetrySDK implements OpenTelemetrySDKInterface {
new ExpressInstrumentation(),
new AwsInstrumentation({
suppressInternalInstrumentation: true,
sqsExtractContextPropagationFromPayload: true,
}),
new TypeormInstrumentation({
collectParameters: false,
suppressInternalInstrumentation: true,
}),
new TypeormInstrumentation(),
winstonInstrumentation,
new IORedisInstrumentation(),
],

View File

@@ -6,11 +6,11 @@ export class OpenTelemetryTracer implements OpenTelemetryTracerInterface {
private parentSpan: OpenTelemetryApi.Span | undefined
private internalSpan: OpenTelemetryApi.Span | undefined
startSpan(parentSpanName: string, internalSpanName: string, activeContext?: OpenTelemetryApi.Context): void {
startSpan(parentSpanName: string, internalSpanName: string): void {
const tracer = OpenTelemetryApi.trace.getTracer(`${parentSpanName}-handler`)
this.parentSpan = tracer.startSpan(parentSpanName, { kind: OpenTelemetryApi.SpanKind.CONSUMER }, activeContext)
const ctx = OpenTelemetryApi.trace.setSpan(activeContext ?? OpenTelemetryApi.context.active(), this.parentSpan)
this.parentSpan = tracer.startSpan(parentSpanName, { kind: OpenTelemetryApi.SpanKind.CONSUMER })
const ctx = OpenTelemetryApi.trace.setSpan(OpenTelemetryApi.context.active(), this.parentSpan)
this.internalSpan = tracer.startSpan(internalSpanName, { kind: OpenTelemetryApi.SpanKind.INTERNAL }, ctx)
}

View File

@@ -1,7 +1,5 @@
import { Context } from '@opentelemetry/api'
export interface OpenTelemetryTracerInterface {
startSpan(parentSpanName: string, internalSpanName: string, activeContext?: Context): void
startSpan(parentSpanName: string, internalSpanName: string): void
stopSpan(): void
stopSpanWithError(error: Error): void
}

View File

@@ -2,21 +2,14 @@ import * as zlib from 'zlib'
import { MessageAttributeValue, PublishCommand, PublishCommandInput, SNSClient } from '@aws-sdk/client-sns'
import { DomainEventInterface, DomainEventPublisherInterface } from '@standardnotes/domain-events'
import { OpenTelemetryPropagationInterface } from '../OpenTelemetry/OpenTelemetryPropagationInterface'
export class SNSOpenTelemetryDomainEventPublisher implements DomainEventPublisherInterface {
constructor(
private propagator: OpenTelemetryPropagationInterface,
private snsClient: SNSClient,
private topicArn: string,
) {}
async publish(event: DomainEventInterface): Promise<void> {
const trace = this.propagator.inject()
if (Object.keys(trace).length > 0) {
event.meta.trace = trace
}
const message: PublishCommandInput = {
TopicArn: this.topicArn,
MessageAttributes: {

View File

@@ -7,14 +7,12 @@ import {
} from '@standardnotes/domain-events'
import { OpenTelemetryTracer } from '../OpenTelemetry/OpenTelemetryTracer'
import { OpenTelemetryTracerInterface } from '../OpenTelemetry/OpenTelemetryTracerInterface'
import { OpenTelemetryPropagationInterface } from '../OpenTelemetry/OpenTelemetryPropagationInterface'
export class SQSOpenTelemetryEventMessageHandler implements DomainEventMessageHandlerInterface {
private tracer: OpenTelemetryTracerInterface | undefined
constructor(
private serviceName: string,
private propagator: OpenTelemetryPropagationInterface,
private handlers: Map<string, DomainEventHandlerInterface>,
private logger: Logger,
) {}
@@ -39,16 +37,7 @@ export class SQSOpenTelemetryEventMessageHandler implements DomainEventMessageHa
this.tracer = new OpenTelemetryTracer()
let activeContext = undefined
if (domainEvent.meta.trace) {
this.logger.debug(`Event has trace: ${JSON.stringify(domainEvent.meta.trace)}`)
activeContext = this.propagator.extract(domainEvent.meta.trace)
this.logger.info(`Injecting pre-existing active context into trace: ${JSON.stringify(activeContext)}`)
}
this.tracer.startSpan(this.serviceName, domainEvent.type, activeContext)
this.tracer.startSpan(this.serviceName, domainEvent.type)
try {
await handler.handle(domainEvent)

View File

@@ -1,8 +1,6 @@
export * from './DirectCall/DirectCallDomainEventPublisher'
export * from './DirectCall/DirectCallEventMessageHandler'
export * from './OpenTelemetry/OpenTelemetryPropagation'
export * from './OpenTelemetry/OpenTelemetryPropagationInterface'
export * from './OpenTelemetry/OpenTelemetrySDK'
export * from './OpenTelemetry/OpenTelemetrySDKInterface'
export * from './OpenTelemetry/OpenTelemetryTracer'

View File

@@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [2.132.2](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.132.1...@standardnotes/domain-events@2.132.2) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
## [2.132.1](https://github.com/standardnotes/server/compare/@standardnotes/domain-events@2.132.0...@standardnotes/domain-events@2.132.1) (2023-10-12)
### Bug Fixes

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/domain-events",
"version": "2.132.1",
"version": "2.132.2",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -9,7 +9,6 @@ export interface DomainEventInterface {
userIdentifier: string
userIdentifierType: 'uuid' | 'email' | 'shared-vault-uuid'
}
trace?: Record<string, string>
origin: DomainEventService
target?: DomainEventService
}

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.13.9](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.13.8...@standardnotes/event-store@1.13.9) (2023-10-12)
**Note:** Version bump only for package @standardnotes/event-store
## [1.13.8](https://github.com/standardnotes/server/compare/@standardnotes/event-store@1.13.7...@standardnotes/event-store@1.13.8) (2023-10-12)
**Note:** Version bump only for package @standardnotes/event-store

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/event-store",
"version": "1.13.8",
"version": "1.13.9",
"description": "Event Store Service",
"private": true,
"main": "dist/src/index.js",

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.30.4](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.30.3...@standardnotes/files-server@1.30.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/files/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/files/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.30.3](https://github.com/standardnotes/files/compare/@standardnotes/files-server@1.30.2...@standardnotes/files-server@1.30.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/files-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/files-server",
"version": "1.30.3",
"version": "1.30.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -16,12 +16,9 @@ import { DomainEventFactory } from '../Domain/Event/DomainEventFactory'
import {
DirectCallDomainEventPublisher,
DirectCallEventMessageHandler,
OpenTelemetryPropagation,
OpenTelemetryPropagationInterface,
SNSOpenTelemetryDomainEventPublisher,
SQSDomainEventSubscriberFactory,
SQSEventMessageHandler,
SQSOpenTelemetryEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { StreamDownloadFile } from '../Domain/UseCase/StreamDownloadFile/StreamDownloadFile'
import { FileDownloaderInterface } from '../Domain/Services/FileDownloaderInterface'
@@ -55,7 +52,6 @@ import { S3FileMover } from '../Infra/S3/S3FileMover'
import { FSFileMover } from '../Infra/FS/FSFileMover'
import { MoveFile } from '../Domain/UseCase/MoveFile/MoveFile'
import { SharedVaultValetTokenAuthMiddleware } from '../Infra/InversifyExpress/Middleware/SharedVaultValetTokenAuthMiddleware'
import { ServiceIdentifier } from '@standardnotes/domain-core'
export class ContainerConfigLoader {
async load(configuration?: {
@@ -100,10 +96,6 @@ export class ContainerConfigLoader {
container.bind<TimerInterface>(TYPES.Files_Timer).toConstantValue(new Timer())
container
.bind<OpenTelemetryPropagationInterface>(TYPES.Files_OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
// services
container
.bind<TokenDecoderInterface<ValetTokenData>>(TYPES.Files_ValetTokenDecoder)
@@ -183,7 +175,6 @@ export class ContainerConfigLoader {
.bind<DomainEventPublisherInterface>(TYPES.Files_DomainEventPublisher)
.toConstantValue(
new SNSOpenTelemetryDomainEventPublisher(
container.get<OpenTelemetryPropagationInterface>(TYPES.Files_OTEL_PROPAGATOR),
container.get(TYPES.Files_SNS),
container.get(TYPES.Files_SNS_TOPIC_ARN),
),
@@ -305,16 +296,7 @@ export class ContainerConfigLoader {
} else {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.Files_DomainEventMessageHandler)
.toConstantValue(
isConfiguredForHomeServerOrSelfHosting
? new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Files_Logger))
: new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.FilesWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.Files_OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Files_Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Files_Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.Files_DomainEventSubscriberFactory)
.toConstantValue(

View File

@@ -5,7 +5,6 @@ const TYPES = {
Files_S3: Symbol.for('Files_S3'),
Files_SNS: Symbol.for('Files_SNS'),
Files_SQS: Symbol.for('Files_SQS'),
Files_OTEL_PROPAGATOR: Symbol.for('Files_OTEL_PROPAGATOR'),
// use cases
Files_UploadFileChunk: Symbol.for('Files_UploadFileChunk'),

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.17.10](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.17.9...@standardnotes/home-server@1.17.10) (2023-10-12)
**Note:** Version bump only for package @standardnotes/home-server
## [1.17.9](https://github.com/standardnotes/server/compare/@standardnotes/home-server@1.17.8...@standardnotes/home-server@1.17.9) (2023-10-12)
**Note:** Version bump only for package @standardnotes/home-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/home-server",
"version": "1.17.9",
"version": "1.17.10",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.45.4](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.45.3...@standardnotes/revisions-server@1.45.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/server/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.45.3](https://github.com/standardnotes/server/compare/@standardnotes/revisions-server@1.45.2...@standardnotes/revisions-server@1.45.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/revisions-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/revisions-server",
"version": "1.45.3",
"version": "1.45.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -1,9 +1,4 @@
import {
ControllerContainer,
ControllerContainerInterface,
MapperInterface,
ServiceIdentifier,
} from '@standardnotes/domain-core'
import { ControllerContainer, ControllerContainerInterface, MapperInterface } from '@standardnotes/domain-core'
import Redis from 'ioredis'
import { Container, interfaces } from 'inversify'
import { MongoRepository, Repository } from 'typeorm'
@@ -39,10 +34,7 @@ import {
SQSDomainEventSubscriberFactory,
DirectCallEventMessageHandler,
DirectCallDomainEventPublisher,
SQSOpenTelemetryEventMessageHandler,
OpenTelemetryPropagation,
SNSOpenTelemetryDomainEventPublisher,
OpenTelemetryPropagationInterface,
} from '@standardnotes/domain-events-infra'
import { DumpRepositoryInterface } from '../Domain/Dump/DumpRepositoryInterface'
import { AccountDeletionRequestedEventHandler } from '../Domain/Handler/AccountDeletionRequestedEventHandler'
@@ -142,10 +134,6 @@ export class ContainerConfigLoader {
container.bind<TimerInterface>(TYPES.Revisions_Timer).toDynamicValue(() => new Timer())
container
.bind<OpenTelemetryPropagationInterface>(TYPES.Revisions_OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
const appDataSource = new AppDataSource({ env, runMigrations: this.mode === 'server' })
await appDataSource.initialize()
@@ -187,7 +175,6 @@ export class ContainerConfigLoader {
.bind<DomainEventPublisherInterface>(TYPES.Revisions_DomainEventPublisher)
.toDynamicValue((context: interfaces.Context) => {
return new SNSOpenTelemetryDomainEventPublisher(
context.container.get<OpenTelemetryPropagationInterface>(TYPES.Revisions_OTEL_PROPAGATOR),
context.container.get(TYPES.Revisions_SNS),
context.container.get(TYPES.Revisions_SNS_TOPIC_ARN),
)
@@ -517,16 +504,7 @@ export class ContainerConfigLoader {
} else {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.Revisions_DomainEventMessageHandler)
.toConstantValue(
isConfiguredForHomeServerOrSelfHosting
? new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Revisions_Logger))
: new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.RevisionsWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.Revisions_OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Revisions_Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Revisions_Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.Revisions_DomainEventSubscriberFactory)

View File

@@ -6,7 +6,6 @@ const TYPES = {
Revisions_SNS: Symbol.for('Revisions_SNS'),
Revisions_S3: Symbol.for('Revisions_S3'),
Revisions_Env: Symbol.for('Revisions_Env'),
Revisions_OTEL_PROPAGATOR: Symbol.for('Revisions_OTEL_PROPAGATOR'),
// Map
Revisions_SQLLegacyRevisionMetadataPersistenceMapper: Symbol.for(
'Revisions_SQLLegacyRevisionMetadataPersistenceMapper',

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.25.4](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.25.3...@standardnotes/scheduler-server@1.25.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/server/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.25.3](https://github.com/standardnotes/server/compare/@standardnotes/scheduler-server@1.25.2...@standardnotes/scheduler-server@1.25.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/scheduler-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/scheduler-server",
"version": "1.25.3",
"version": "1.25.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -15,11 +15,9 @@ import TYPES from './Types'
import { AppDataSource } from './DataSource'
import { DomainEventFactory } from '../Domain/Event/DomainEventFactory'
import {
OpenTelemetryPropagation,
OpenTelemetryPropagationInterface,
SNSOpenTelemetryDomainEventPublisher,
SQSDomainEventSubscriberFactory,
SQSOpenTelemetryEventMessageHandler,
SQSEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { Timer, TimerInterface } from '@standardnotes/time'
import { PredicateRepositoryInterface } from '../Domain/Predicate/PredicateRepositoryInterface'
@@ -37,7 +35,6 @@ import { VerifyPredicates } from '../Domain/UseCase/VerifyPredicates/VerifyPredi
import { UserRegisteredEventHandler } from '../Domain/Handler/UserRegisteredEventHandler'
import { SubscriptionCancelledEventHandler } from '../Domain/Handler/SubscriptionCancelledEventHandler'
import { ExitDiscountAppliedEventHandler } from '../Domain/Handler/ExitDiscountAppliedEventHandler'
import { ServiceIdentifier } from '@standardnotes/domain-core'
export class ContainerConfigLoader {
async load(): Promise<Container> {
@@ -68,10 +65,6 @@ export class ContainerConfigLoader {
})
container.bind<winston.Logger>(TYPES.Logger).toConstantValue(logger)
container
.bind<OpenTelemetryPropagationInterface>(TYPES.Scheduler_OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
if (env.get('SNS_TOPIC_ARN', true)) {
const snsConfig: SNSClientConfig = {
apiVersion: 'latest',
@@ -143,11 +136,7 @@ export class ContainerConfigLoader {
container
.bind<DomainEventPublisherInterface>(TYPES.DomainEventPublisher)
.toConstantValue(
new SNSOpenTelemetryDomainEventPublisher(
container.get<OpenTelemetryPropagationInterface>(TYPES.Scheduler_OTEL_PROPAGATOR),
container.get(TYPES.SNS),
container.get(TYPES.SNS_TOPIC_ARN),
),
new SNSOpenTelemetryDomainEventPublisher(container.get(TYPES.SNS), container.get(TYPES.SNS_TOPIC_ARN)),
)
const eventHandlers: Map<string, DomainEventHandlerInterface> = new Map([
@@ -159,14 +148,7 @@ export class ContainerConfigLoader {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.DomainEventMessageHandler)
.toConstantValue(
new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.SchedulerWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.Scheduler_OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.DomainEventSubscriberFactory)
.toConstantValue(

View File

@@ -3,7 +3,6 @@ const TYPES = {
Redis: Symbol.for('Redis'),
SNS: Symbol.for('SNS'),
SQS: Symbol.for('SQS'),
Scheduler_OTEL_PROPAGATOR: Symbol.for('Scheduler_OTEL_PROPAGATOR'),
// env vars
REDIS_URL: Symbol.for('REDIS_URL'),
SNS_TOPIC_ARN: Symbol.for('SNS_TOPIC_ARN'),

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.117.4](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.117.3...@standardnotes/syncing-server@1.117.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/syncing-server-js/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/syncing-server-js/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.117.3](https://github.com/standardnotes/syncing-server-js/compare/@standardnotes/syncing-server@1.117.2...@standardnotes/syncing-server@1.117.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/syncing-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/syncing-server",
"version": "1.117.3",
"version": "1.117.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -13,12 +13,9 @@ import { Item } from '../Domain/Item/Item'
import {
DirectCallDomainEventPublisher,
DirectCallEventMessageHandler,
OpenTelemetryPropagation,
OpenTelemetryPropagationInterface,
SNSOpenTelemetryDomainEventPublisher,
SQSDomainEventSubscriberFactory,
SQSEventMessageHandler,
SQSOpenTelemetryEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { DomainEventFactoryInterface } from '../Domain/Event/DomainEventFactoryInterface'
import { DomainEventFactory } from '../Domain/Event/DomainEventFactory'
@@ -65,7 +62,6 @@ import {
ControllerContainer,
ControllerContainerInterface,
MapperInterface,
ServiceIdentifier,
SharedVaultUser,
} from '@standardnotes/domain-core'
import { BaseItemsController } from '../Infra/InversifyExpressUtils/Base/BaseItemsController'
@@ -218,10 +214,6 @@ export class ContainerConfigLoader {
}
container.bind<winston.Logger>(TYPES.Sync_Logger).toConstantValue(logger)
container
.bind<OpenTelemetryPropagationInterface>(TYPES.Sync_OTEL_PROPAGATOR)
.toConstantValue(new OpenTelemetryPropagation())
const appDataSource = new AppDataSource({ env, runMigrations: this.mode === 'server' })
await appDataSource.initialize()
@@ -293,7 +285,6 @@ export class ContainerConfigLoader {
.bind<DomainEventPublisherInterface>(TYPES.Sync_DomainEventPublisher)
.toDynamicValue((context: interfaces.Context) => {
return new SNSOpenTelemetryDomainEventPublisher(
context.container.get<OpenTelemetryPropagationInterface>(TYPES.Sync_OTEL_PROPAGATOR),
context.container.get(TYPES.Sync_SNS),
context.container.get(TYPES.Sync_SNS_TOPIC_ARN),
)
@@ -1159,16 +1150,7 @@ export class ContainerConfigLoader {
} else {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.Sync_DomainEventMessageHandler)
.toConstantValue(
isConfiguredForHomeServerOrSelfHosting
? new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Sync_Logger))
: new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.SyncingServerWorker,
container.get<OpenTelemetryPropagationInterface>(TYPES.Sync_OTEL_PROPAGATOR),
eventHandlers,
container.get(TYPES.Sync_Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Sync_Logger)))
}
container

View File

@@ -6,7 +6,6 @@ const TYPES = {
Sync_SQS: Symbol.for('Sync_SQS'),
Sync_S3: Symbol.for('Sync_S3'),
Sync_Env: Symbol.for('Sync_Env'),
Sync_OTEL_PROPAGATOR: Symbol.for('Sync_OTEL_PROPAGATOR'),
// Repositories
Sync_ItemRepositoryResolver: Symbol.for('Sync_ItemRepositoryResolver'),
Sync_SQLItemRepository: Symbol.for('Sync_SQLItemRepository'),

View File

@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.16.4](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.16.3...@standardnotes/websockets-server@1.16.4) (2023-10-12)
### Bug Fixes
* disable opentelemetry tracing on async worker jobs ([e0b19ef](https://github.com/standardnotes/server/commit/e0b19ef011197c854cb6e833dbaa982f661e8d17))
* disable sqs open telemetry manual tracing in favour of automated instrumentation ([337eae7](https://github.com/standardnotes/server/commit/337eae73c6cb18ae872527b06f6c23e1c48b6dff))
## [1.16.3](https://github.com/standardnotes/server/compare/@standardnotes/websockets-server@1.16.2...@standardnotes/websockets-server@1.16.3) (2023-10-12)
**Note:** Version bump only for package @standardnotes/websockets-server

View File

@@ -1,6 +1,6 @@
{
"name": "@standardnotes/websockets-server",
"version": "1.16.3",
"version": "1.16.4",
"engines": {
"node": ">=18.0.0 <21.0.0"
},

View File

@@ -18,11 +18,7 @@ import { RedisWebSocketsConnectionRepository } from '../Infra/Redis/RedisWebSock
import { AddWebSocketsConnection } from '../Domain/UseCase/AddWebSocketsConnection/AddWebSocketsConnection'
import { RemoveWebSocketsConnection } from '../Domain/UseCase/RemoveWebSocketsConnection/RemoveWebSocketsConnection'
import { WebSocketsClientMessenger } from '../Infra/WebSockets/WebSocketsClientMessenger'
import {
OpenTelemetryPropagation,
SQSDomainEventSubscriberFactory,
SQSOpenTelemetryEventMessageHandler,
} from '@standardnotes/domain-events-infra'
import { SQSDomainEventSubscriberFactory, SQSEventMessageHandler } from '@standardnotes/domain-events-infra'
import { ApiGatewayAuthMiddleware } from '../Controller/ApiGatewayAuthMiddleware'
import {
@@ -38,7 +34,6 @@ import { WebSocketsController } from '../Controller/WebSocketsController'
import { WebSocketServerInterface } from '@standardnotes/api'
import { ClientMessengerInterface } from '../Client/ClientMessengerInterface'
import { WebSocketMessageRequestedEventHandler } from '../Domain/Handler/WebSocketMessageRequestedEventHandler'
import { ServiceIdentifier } from '@standardnotes/domain-core'
export class ContainerConfigLoader {
async load(): Promise<Container> {
@@ -145,14 +140,7 @@ export class ContainerConfigLoader {
container
.bind<DomainEventMessageHandlerInterface>(TYPES.DomainEventMessageHandler)
.toConstantValue(
new SQSOpenTelemetryEventMessageHandler(
ServiceIdentifier.NAMES.WebsocketsWorker,
new OpenTelemetryPropagation(),
eventHandlers,
container.get(TYPES.Logger),
),
)
.toConstantValue(new SQSEventMessageHandler(eventHandlers, container.get(TYPES.Logger)))
container
.bind<DomainEventSubscriberFactoryInterface>(TYPES.DomainEventSubscriberFactory)
.toConstantValue(