Skip to content

[CockroachDB] Add initial draft for cockroachdb logs #14568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

herrBez
Copy link
Contributor

@herrBez herrBez commented Jul 16, 2025

Proposed commit message

Add experimental cockroachdb log dataset.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

How to test this PR locally

We can use the following docker-compose:

services:
  # Read file docker exec -it roach-single grep 'node starting' /cockroach/cockroach-data/logs/cockroach.log -A 11
  roach-single:
    image: cockroachdb/cockroach:v25.2.2
    container_name: roach-single
    hostname: roach-single
    ports:
      - "26257:26257"
      - "8080:8080"
    environment:
      - COCKROACH_DATABASE=testdb
      - COCKROACH_USER=test
      - COCKROACH_PASSWORD=testtest
    volumes:
      - roach-single-data:/cockroach/cockroach-data
      - ./logs.yaml:/cockroach/logs.yaml:ro
    command: "start-single-node --http-addr=roach-single:8080 --insecure --log-config-file /cockroach/logs.yaml"

  elastic-agent:
    image: docker.elastic.co/elastic-agent/elastic-agent:8.19.0-SNAPSHOT
    container_name: elastic_agent-cockroach
    volumes:
      - ./elastic-agent.yml:/usr/share/elastic-agent/elastic-agent.yml
      - type: volume
        source: roach-single-data
        target: /cockroachlogs
        volume:
          subpath: logs/
    environment:
      - ES_ENDPOINT=XXXX
      - ES_API_KEY=XXX
    restart: unless-stopped

volumes:
  roach-single-data:

And the following elastic-agent.yml:

outputs:
  default:
    type: elasticsearch
    hosts: ["${ES_ENDPOINT}"]
    api_key: "${ES_API_KEY}"
    preset: balanced

inputs:
  - id: filestream-filestream-a14e7e70-5b94-44cb-abc1-9e43f6991a85
    name: filestream-cockroach
    revision: 1
    type: filestream
    use_output: default
    meta:
      package:
        name: filestream
        version: 1.1.3
    data_stream:
      namespace: default
    streams:
      - id: filestream-cockroach-generic-a14e7e70-5b94-44cb-abc1-9e43f6991a85
        data_stream:
          dataset: cockroachdb.log
        paths:
          - /cockroachlogs/cockroach*.log

And the following logs.yaml:

file-defaults:
  format: json
  format-options:
    datetime-format: iso8601

Related issues

Screenshots

image

@andrewkroh andrewkroh added Integration:cockroachdb CockroachDB Metrics documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. labels Jul 16, 2025
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
6.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@elasticmachine
Copy link

💚 Build Succeeded

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:cockroachdb CockroachDB Metrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants