kandi background
Explore Kits

django-elasticsearch-metrics | Django app for storing time | Time Series Database library

 by   CenterForOpenScience Python Version: Current License: MIT

 by   CenterForOpenScience Python Version: Current License: MIT

Download this library from

kandi X-RAY | django-elasticsearch-metrics Summary

django-elasticsearch-metrics is a Python library typically used in Database, Time Series Database applications. django-elasticsearch-metrics has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install django-elasticsearch-metrics' or download it from GitHub, PyPI.
Django app for storing time-series metrics in Elasticsearch.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • django-elasticsearch-metrics has a low active ecosystem.
  • It has 8 star(s) with 5 fork(s). There are 2 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 2 open issues and 11 have been closed. On average issues are closed in 9 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of django-elasticsearch-metrics is current.
This Library - Support
Best in #Time Series Database
Average in #Time Series Database
This Library - Support
Best in #Time Series Database
Average in #Time Series Database

quality kandi Quality

  • django-elasticsearch-metrics has 0 bugs and 10 code smells.
This Library - Quality
Best in #Time Series Database
Average in #Time Series Database
This Library - Quality
Best in #Time Series Database
Average in #Time Series Database

securitySecurity

  • django-elasticsearch-metrics has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • django-elasticsearch-metrics code analysis shows 0 unresolved vulnerabilities.
  • There are 2 security hotspots that need review.
This Library - Security
Best in #Time Series Database
Average in #Time Series Database
This Library - Security
Best in #Time Series Database
Average in #Time Series Database

license License

  • django-elasticsearch-metrics is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
This Library - License
Best in #Time Series Database
Average in #Time Series Database
This Library - License
Best in #Time Series Database
Average in #Time Series Database

buildReuse

  • django-elasticsearch-metrics releases are not available. You will need to build from source code and install.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • It has 920 lines of code, 78 functions and 31 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
This Library - Reuse
Best in #Time Series Database
Average in #Time Series Database
This Library - Reuse
Best in #Time Series Database
Average in #Time Series Database
Top functions reviewed by kandi - BETA

kandi has reviewed django-elasticsearch-metrics and discovered the below as its top functions. This is intended to give you an instant insight into django-elasticsearch-metrics implemented functionality, and help decide if they suit your requirements.

  • Create a new MetricMeta .
  • Sync metrics .
  • Return metric for given app label .
  • Save the metric .
  • Find the version from a file .
  • Get color style .
  • Create a color scheme .
  • Initialize index template .
  • Create a new model instance .
  • Read content of file .

django-elasticsearch-metrics Key Features

Django app for storing time-series metrics in Elasticsearch.

Install

copy iconCopydownload iconDownload
pip install django-elasticsearch-metrics

Quickstart

copy iconCopydownload iconDownload
INSTALLED_APPS += ["elasticsearch_metrics"]

Per-month or per-year indices

copy iconCopydownload iconDownload
# settings.py

# Monthly:
ELASTICSEARCH_METRICS_DATE_FORMAT = "%Y.%m"

# Yearly:
ELASTICSEARCH_METRICS_DATE_FORMAT = "%Y"

Index settings

copy iconCopydownload iconDownload
class PageView(metrics.Metric):
    user_id = metrics.Integer()

    class Index:
        settings = {"number_of_shards": 2, "refresh_interval": "5s"}

Index templates

copy iconCopydownload iconDownload
class PageView(metrics.Metric):
    class Meta:
        app_label = "myapp"

Abstract metrics

copy iconCopydownload iconDownload
from elasticsearch_metrics import metrics


class MyBaseMetric(metrics.Metric):
    user_id = metrics.Integer()

    class Meta:
        abstract = True


class PageView(MyBaseMetric):
    class Meta:
        app_label = "myapp"

Optional factory_boy integration

copy iconCopydownload iconDownload
import factory
from elasticsearch_metrics.factory import MetricFactory

from ..myapp.metrics import MyMetric


class MyMetricFactory(MetricFactory):
    my_int = factory.Faker("pyint")

    class Meta:
        model = MyMetric


def test_something():
    metric = MyMetricFactory()  # index metric in ES
    assert isinstance(metric.my_int, int)

Caveats

copy iconCopydownload iconDownload
class MyMetric(metrics.Metric):
    class Meta:
        source = metrics.MetaField(enabled=True)

Community Discussions

Trending Discussions on Time Series Database
  • How do I instrument region and environment information correctly in Prometheus?
  • Amazon EKS (NFS) to Kubernetes pod. Can't mount volume
  • InfluxDB not starting: 8086 bind address already in use
  • Writing the data to the timeseries database over unstable network
  • Recommended approach to store multi-dimensional data (e.g. spectra) in InfluxDB
  • What to report in a time serie database when the measure failed?
  • R ggplot customize month labels in time series
  • How Can I Generate A Visualisation with Multiple Data Series In Splunk
  • How can I deploy QuestDB on GCP?
  • Group By day for custom time interval
Trending Discussions on Time Series Database

QUESTION

How do I instrument region and environment information correctly in Prometheus?

Asked 2022-Mar-09 at 17:53

I've an application, and I'm running one instance of this application per AWS region. I'm trying to instrument the application code with Prometheus metrics client, and will be exposing the collected metrics to the /metrics endpoint. There is a central server which will scrape the /metrics endpoints across all the regions and will store them in a central Time Series Database.

Let's say I've defined a metric named: http_responses_total then I would like to know its value aggregated over all the regions along with individual regional values. How do I store this region information which could be any one of the 13 regions and env information which could be dev or test or prod along with metrics so that I can slice and dice metrics based on region and env?

I found a few ways to do it, but not sure how it's done in general, as it seems a pretty common scenario:

I'm new to Prometheus. Could someone please suggest how I should store this region and env information? Are there any other better ways?

ANSWER

Answered 2022-Mar-09 at 17:53

All the proposed options will work, and all of them have downsides.

The first option (having env and region exposed by the application with every metric) is easy to implement but hard to maintain. Eventually somebody will forget to about these, opening a possibility for an unobserved failure to occur. Aside from that, you may not be able to add these labels to other exporters, written by someone else. Lastly, if you have to deal with millions of time series, more plain text data means more traffic.

The third option (storing these labels in a separate metric) will make it quite difficult to write and understand queries. Take this one for example:

sum by(instance) (node_arp_entries) and on(instance) node_exporter_build_info{version="0.17.0"}

It calculates a sum of node_arp_entries for instances with node-exporter version="0.17.0". Well more specifically it calculates a sum for every instance and then just drops those with a wrong version, but you got the idea.

The second option (adding these labels with Prometheus as a part of scrape configuration) is what I would choose. To save the words, consider this monitoring setup:

Datacener Prometheus Regional Prometheus Global Prometheus
1. Collects metrics from local instances. 2. Adds dc label to each metric. 3. Pushes the data into the regional Prometheus -> 1. Collects data on datacenter scale. 2. Adds region label to all metrics. 3. Pushes the data into the global instance -> Simply collects and stores the data on global scale

This is the kind of setup you need on Google scale, but the point is the simplicity. It's perfectly clear where each label comes from and why. This approach requires you to make Prometheus configuration somewhat more complicated, and the less Prometheus instances you have, the more scrape configurations you will need. Overall, I think, this option beats the alternatives.

Source https://stackoverflow.com/questions/71408188

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install django-elasticsearch-metrics

Add "elasticseach_metrics" to INSTALLED_APPS. Define the ELASTICSEARCH_DSL setting. This setting is passed to elasticsearch_dsl.connections.configure so it takes the same parameters. In one of your apps, define a new metric in metrics.py. A Metric is a subclass of elasticsearch_dsl.Document. Use the sync_metrics management command to ensure that the index template for your metric is created in Elasticsearch.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Time Series Database Libraries
Compare Time Series Database Libraries with Highest Support
Compare Time Series Database Libraries with Highest Security
Compare Time Series Database Libraries with Permissive License
Compare Time Series Database Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.