open-index/open-npm huggingface dataset:
npm package: @marinade.finance/nestjs-apollo-prometheus
Description: Prometheus metrics plugin for Apollo GraphQL in NestJS
Latest version: 4.2.6

# @marinade.finance/nestjs-apollo-prometheus

Prometheus metrics plugin for Apollo Server 4 in NestJS applications.
Separate package due to `@apollo/server` and `prom-client` peer dependencies.

## Installation

```bash
pnpm add @marinade.finance/nestjs-apollo-prometheus
```

### Peer Dependencies

```bash
pnpm add @nestjs/common @nestjs/apollo @apollo/server prom-client
```

## Usage

```typescript
import { Module } from '@nestjs/common'
import { GraphQLModule } from '@nestjs/graphql'
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'
import { ApolloPrometheusModule } from '@marinade.finance/nestjs-apollo-prometheus'

@Module({
  imports: [
    ApolloPrometheusModule.forRoot(() => ({
      prefix: 'graphql',
    })),
    GraphQLModule.forRoot<ApolloDriverConfig>({
      driver: ApolloDriver,
      autoSchemaFile: true,
    }),
  ],
})
export class AppModule {}
```

### Async Configuration

```typescript
ApolloPrometheusModule.forRoot(async () => {
  const prefix = await loadPrefix()
  return { prefix }
})
```

## Configuration

```typescript
interface ApolloPrometheusConfig {
  // Metric name prefix (default: 'graphql')
  prefix?: string

  // Custom metric names
  metrics?: {
    operationsTotal?: string      // default: 'operations_total'
    operationDuration?: string    // default: 'operation_duration_seconds'
  }

  // Duration histogram buckets in seconds
  // default: [0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]
  durationBuckets?: number[]

  // Skip tracking introspection queries (default: true)
  skipIntrospection?: boolean
}
```

## Metrics

### Operations Counter

`{prefix}_operations_total` (default: `graphql_operations_total`)

Labels: `operation_name`, `operation_type`, `status`

### Duration Histogram

`{prefix}_operation_duration_seconds` (default: `graphql_operation_duration_seconds`)

Labels: `operation_name`, `operation_type`

## Querying

```promql
# Total operations by type
sum by (operation_type) (graphql_operations_total)

# Error rate
rate(graphql_operations_total{status="error"}[5m])

# 95th percentile latency
histogram_quantile(0.95, rate(graphql_operation_duration_seconds_bucket[5m]))
```

## License

See repository root for license information.
npm package: @marinade.finance/notifications-ts-message
Description: Core types and validation for Marinade Messaging Standard.
Latest version: 1.0.0

# ts-message

Core types and validation for Marinade Messaging Standard.

## Types

```typescript
interface Message<T> {
  header: Header
  payload: T
}

interface Header {
  producer_id: string
  message_id: string // Producer-generated unique identifier (UUID v7 recommended)
  created_at: number // Client timestamp (ms)
  received_at?: number // Service timestamp (ms), filled on POST
  topic?: string
}
```

## Validation

```typescript
import { HeaderValidator } from 'ts-message'

HeaderValidator.validate(header) // Throws on invalid
```

## Utilities

```typescript
import { createMessageSchema, HEADER_SCHEMA } from 'ts-message'

const schema = createMessageSchema(HEADER_SCHEMA, payloadSchema)
```

## Usage

Producer:

```typescript
import type { Message, Header } from 'ts-message'

const message: Message<PayloadType> = {
  header: {
    producer_id: 'service',
    message_id: uuidv7(), // import { v7 as uuidv7 } from 'uuid'
    created_at: Date.now(),
  },
  payload: {
    /* ... */
  },
}
```

Consumer:

```typescript
import { HeaderValidator } from 'ts-message'
import { PayloadValidator } from 'generated-package'

HeaderValidator.validate(message.header)
PayloadValidator.validate(message.payload)
```