LogDrains.constants.tsx133 lines · main
1import { components } from 'api-types'
2import { Axiom, Datadog, Grafana, Last9, Otlp, Sentry } from 'icons'
3import { BracesIcon, Cloud, Server } from 'lucide-react'
4
5const iconProps = {
6 height: 24,
7 width: 24,
8 className: 'text-foreground-light',
9}
10
11export type LogDrainType = components['schemas']['CreateBackendParamsOpenapi']['type']
12
13export const LOG_DRAIN_TYPES = [
14 {
15 value: 'webhook',
16 name: 'Custom Endpoint',
17 description: 'Forward logs as a POST request to a custom HTTP endpoint',
18 icon: <BracesIcon {...iconProps} />,
19 },
20 {
21 value: 'otlp',
22 name: 'OpenTelemetry Protocol (OTLP)',
23 description: 'Send logs to any OpenTelemetry Protocol (OTLP) compatible endpoint',
24 icon: <Otlp {...iconProps} fill="currentColor" />,
25 },
26 {
27 value: 'datadog',
28 name: 'Datadog',
29 description: 'Datadog is a monitoring service for cloud-scale applications',
30 icon: <Datadog {...iconProps} fill="currentColor" />,
31 },
32 {
33 value: 'loki',
34 name: 'Loki',
35 description:
36 'Loki is an open-source log aggregation system designed to store and query logs from multiple sources',
37 icon: <Grafana {...iconProps} fill="currentColor" />,
38 },
39 {
40 value: 's3',
41 name: 'Amazon S3',
42 description: 'Forward logs to an S3 bucket',
43 icon: <Cloud {...iconProps} />,
44 },
45 {
46 value: 'sentry',
47 name: 'Sentry',
48 description:
49 'Sentry is an application monitoring service that helps developers identify and debug performance issues and errors',
50 icon: <Sentry {...iconProps} fill="currentColor" />,
51 },
52 {
53 value: 'axiom',
54 name: 'Axiom',
55 description:
56 'Axiom is a data platform designed to efficiently collect, store, and analyze event and telemetry data at massive scale.',
57 icon: <Axiom {...iconProps} fill="currentColor" />,
58 },
59 {
60 value: 'last9',
61 name: 'Last9',
62 description: 'Last9 is an observability platform for monitoring and telemetry data',
63 icon: <Last9 {...iconProps} fill="currentColor" />,
64 },
65 {
66 value: 'syslog',
67 name: 'Syslog',
68 description: 'Forward logs to a remote Syslog receiver using TCP or TLS, adhering to RFC 5424',
69 icon: <Server {...iconProps} />,
70 },
71] as const
72
73export const LOG_DRAIN_SOURCE_VALUES = LOG_DRAIN_TYPES.map((source) => source.value)
74
75export const DATADOG_REGIONS = [
76 {
77 label: 'AP1',
78 value: 'AP1',
79 },
80 {
81 label: 'AP2',
82 value: 'AP2',
83 },
84 {
85 label: 'EU',
86 value: 'EU',
87 },
88 {
89 label: 'US1',
90 value: 'US1',
91 },
92 {
93 label: 'US1-FED',
94 value: 'US1-FED',
95 },
96 {
97 label: 'US3',
98 value: 'US3',
99 },
100 {
101 label: 'US5',
102 value: 'US5',
103 },
104] as const
105
106export const LAST9_REGIONS = [
107 {
108 label: 'US West 1',
109 value: 'US-WEST-1',
110 },
111 {
112 label: 'AP South 1',
113 value: 'AP-SOUTH-1',
114 },
115] as const
116
117export type LogDrainDatadogConfig = {
118 api_key: string
119 region: string
120}
121
122export type LogDrainWebhookConfig = {
123 url: string
124}
125
126export const OTLP_PROTOCOLS = [{ label: 'HTTP/Protobuf', value: 'http/protobuf' }] as const
127
128export type LogDrainOtlpConfig = {
129 endpoint: string
130 protocol?: string
131 gzip?: boolean
132 headers?: Record<string, string>
133}