apiVersion: v1
kind: ConfigMap
metadata:
  name: loki-datasource
  namespace: observability-stack
  labels:
    grafana_datasource: "true"
data:
  loki-datasource.yaml: |-
    apiVersion: 1
    datasources:
      - name: Loki
        type: loki
        uid: loki-thomas-vitale
        access: proxy
        orgId: 1
        url: http://loki-stack:3100
        isDefault: true
        version: 1
        editable: true
        jsonData:
          derivedFields:
            - datasourceUid: tempo-thomas-vitale
              matcherRegex: '\S+ \w+ \w+ \d+\-\d+\-\d+ \d+\:\d+\:\d+\.\d+\s+\w+\s+\[[\w-]+\,(\w+)\,\w+\]'
              name: TraceID
              url: '$${__value.raw}'
