Skip to content

Can it support the collection of cloud databases #517

Closed Answered by burningalchemist
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to store any information in Prometheus, you have to follow its format (I posted the link above). So try maybe this snippet (change it accordingly to your requirements):

# Metric with a static value to retrieve string data.
- metric_name: mysql_data
  type: gauge
  help: 'Database server data'
  key_labels:
    # Populated from the columns of the result.
    - id
    - user
    - host
    - db
    - command
    - time
    - state
    - sql_text
    - trx_time
  # Static value, always set to `1`.
  static_value: 1
  query: |
    SELECT
    pl.ID AS id,
    pl.USER AS user,
    SUBSTRING_INDEX(pl.HOST, ':', 1) AS host,
    pl.DB AS db,
    pl.COMMAND AS command,
    pl.TIME AS ti…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@ghost
Comment options

@burningalchemist
Comment options

@ghost
Comment options

@burningalchemist
Comment options

Answer selected by burningalchemist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #516 on May 26, 2024 16:07.