constants.go 1.8 KB

123456789101112131415161718192021
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package cassandraexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/cassandraexporter"
  4. const (
  5. // language=SQL
  6. createDatabaseSQL = `CREATE KEYSPACE IF NOT EXISTS %s WITH REPLICATION = { 'class' : '%s', 'replication_factor' : %d };`
  7. // language=SQL
  8. createEventTypeSQL = `CREATE TYPE IF NOT EXISTS %s.Events (Timestamp Date, Name text, Attributes map<text, text>);`
  9. // language=SQL
  10. createLinksTypeSQL = `CREATE TYPE IF NOT EXISTS %s.Links (TraceId text, SpanId text, TraceState text, Attributes map<text, text>);`
  11. // language=SQL
  12. createSpanTableSQL = `CREATE TABLE IF NOT EXISTS %s.%s (TimeStamp DATE, TraceId text, SpanId text, ParentSpanId text, TraceState text, SpanName text, SpanKind text, ResourceAttributes map<text, text>, SpanAttributes map<text, text>, Duration int, StatusCode text, StatusMessage text, Events frozen<Events>, Links frozen<Links>, PRIMARY KEY (SpanId)) WITH COMPRESSION = {'class': '%s'}`
  13. // language=SQL
  14. insertSpanSQL = `INSERT INTO %s.%s (timestamp, traceid, spanid, parentspanid, tracestate, spanname, spankind, resourceattributes, spanattributes, duration, statuscode, statusmessage) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
  15. // language=SQL
  16. createLogTableSQL = `CREATE TABLE IF NOT EXISTS %s.%s (TimeStamp TimeStamp, TraceId text, SpanId text, TraceFlags int, SeverityText text, SeverityNumber int, Body text, ResourceAttributes map<text, text>, LogAttributes map<text, text>, PRIMARY KEY (SpanId, SeverityNumber)) WITH COMPRESSION = {'class': '%s'}`
  17. // language=SQL
  18. insertLogTableSQL = `INSERT INTO %s.%s (timestamp, traceid, spanid, traceflags, severitytext, severitynumber, body, resourceattributes, logattributes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)`
  19. )