LogDrains.constants.tsx 3.1 KB

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