Code Monkey home page Code Monkey logo

servicebus_exporter's Introduction

Azure Service Bus Prometheus exporter

Azure Service Bus metrics Prometheus exporter. Does not use Azure Monitor, connects to the Service Bus directly and scrapes all queues, topics and subscriptions.

Installation

From source

You need to have a Go 1.10+ environment configured. Clone the repo (outside your GOPATH) and then:

go build -o servicebus_exporter
./servicebus_exporter --connection-string=[YOUR CONNECTION STRING]

Using Docker

docker run -d -p 9580:9580 -e CONNECTION_STRING=[YOUR CONNECTION STRING] marcinbudny/servicebus_exporter

Configuration

The exporter can be configured with commandline arguments, environment variables and a configuration file. For the details on how to format the configuration file, visit namsral/flag repo.

Flag ENV variable Default Meaning
--connection-string CONNECTION_STRING no default Connection string for Azure Service Bus. The exporter requires Manage SAS policy.
--port PORT 9580 Port to expose scrape endpoint on
--timeout TIMEOUT 30s Timeout when scraping the Service Bus
--verbose VERBOSE false Enable verbose logging

Exported metrics

See here for explanation of different message count types.

# HELP servicebus_queue_active_messages Queue active messages count
# TYPE servicebus_queue_active_messages gauge
servicebus_queue_active_messages{name="somequeue"} 0
# HELP servicebus_queue_dead_letter_messages Queue dead letter messages count
# TYPE servicebus_queue_dead_letter_messages gauge
servicebus_queue_dead_letter_messages{name="somequeue"} 0
# HELP servicebus_queue_max_size_bytes Queue maximum size in bytes
# TYPE servicebus_queue_max_size_bytes gauge
servicebus_queue_max_size_bytes{name="somequeue"} 1.073741824e+09
# HELP servicebus_queue_scheduled_messages Queue scheduled messages count
# TYPE servicebus_queue_scheduled_messages gauge
servicebus_queue_scheduled_messages{name="somequeue"} 0
# HELP servicebus_queue_size_bytes Queue size in bytes
# TYPE servicebus_queue_size_bytes gauge
servicebus_queue_size_bytes{name="somequeue"} 0
# HELP servicebus_queue_transfer_dead_letter_messages Queue transfer dead letter messages count
# TYPE servicebus_queue_transfer_dead_letter_messages gauge
servicebus_queue_transfer_dead_letter_messages{name="somequeue"} 0
# HELP servicebus_queue_transfer_messages Queue transfer messages count
# TYPE servicebus_queue_transfer_messages gauge
servicebus_queue_transfer_messages{name="somequeue"} 0

# HELP servicebus_subscription_active_messages Subscription active messages count
# TYPE servicebus_subscription_active_messages gauge
servicebus_subscription_active_messages{name="somesubscription",topic_name="sometopic"} 0
# HELP servicebus_subscription_dead_letter_messages Subscription dead letter messages count
# TYPE servicebus_subscription_dead_letter_messages gauge
servicebus_subscription_dead_letter_messages{name="somesubscription",topic_name="sometopic"} 0
# HELP servicebus_subscription_scheduled_messages Subscription scheduled messages count
# TYPE servicebus_subscription_scheduled_messages gauge
servicebus_subscription_scheduled_messages{name="somesubscription",topic_name="sometopic"} 0
# HELP servicebus_subscription_transfer_dead_letter_messages Subscription transfer dead letter messages count
# TYPE servicebus_subscription_transfer_dead_letter_messages gauge
servicebus_subscription_transfer_dead_letter_messages{name="somesubscription",topic_name="sometopic"} 0
# HELP servicebus_subscription_transfer_messages Subscription transfer messages count
# TYPE servicebus_subscription_transfer_messages gauge
servicebus_subscription_transfer_messages{name="somesubscription",topic_name="sometopic"} 0

# HELP servicebus_topic_active_messages Topic active messages count
# TYPE servicebus_topic_active_messages gauge
servicebus_topic_active_messages{name="sometopic"} 0
# HELP servicebus_topic_dead_letter_messages Topic dead letter messages count
# TYPE servicebus_topic_dead_letter_messages gauge
servicebus_topic_dead_letter_messages{name="sometopic"} 0
# HELP servicebus_topic_max_size_bytes Topic maximum size in bytes
# TYPE servicebus_topic_max_size_bytes gauge
servicebus_topic_max_size_bytes{name="sometopic"} 1.073741824e+09
# HELP servicebus_topic_scheduled_messages Topic scheduled messages count
# TYPE servicebus_topic_scheduled_messages gauge
servicebus_topic_scheduled_messages{name="sometopic"} 0
# HELP servicebus_topic_size_bytes Topic size in bytes
# TYPE servicebus_topic_size_bytes gauge
servicebus_topic_size_bytes{name="sometopic"} 0
# HELP servicebus_topic_transfer_dead_letter_messages Topic transfer dead letter messages count
# TYPE servicebus_topic_transfer_dead_letter_messages gauge
servicebus_topic_transfer_dead_letter_messages{name="sometopic"} 0
# HELP servicebus_topic_transfer_messages Topic transfer messages count
# TYPE servicebus_topic_transfer_messages gauge
servicebus_topic_transfer_messages{name="sometopic"} 0

# HELP servicebus_up Whether the Azure ServiceBus scrape was successful
# TYPE servicebus_up gauge
servicebus_up 1

servicebus_exporter's People

Contributors

marcinbudny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

servicebus_exporter's Issues

grafana dashboard

Hey, this project is really cool. Does anyone have a grafana dashboard they're willing to share?

Perhaps a recommended dashboard could be published here and then linked to in the README.

limits for queues metrics

I have something like 20000 queues, that I tried to monitor based on this code.
but I see only 200 queues Is there any option there is a limit? for the monitor queues?

Not all topics being shown

We have over 200 topics.
Grafana is only displaying some.
I have adjusted the timeout on this exporter.

Running curl 10.xxx.xxx.xx:9580/metrics

It does not show all the topics either.

Update to azure-sdk-for-go

Current Azure Go SDK has been retired, since they are switching to a more unified Azure Go SDK.

Made a PR for this here: #6

Metrics are collected synchronously during a scrape?

Hi there, thanks for this exporter - I think it might be really useful for us!

I've not delved into the code too deeply, but it seems that the retrieval of metrics from the SB API is done synchronously upon a request to the /metrics endpoint? We have SB namespaces that have a lot of topics and subscriptions, and so a GET to /metrics can take upwards of 5-7 seconds to return.

I think typically, responses to calls to the /metrics endpoints should be completely decoupled from the metric population itself.

Data retention

How do I configure data retention for say only 1 week?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.