Skip to main content

A Python client to export a New Relic dashboard PDF or image programmatically.

Project description

dashboard-exporter

A Python client to export a New Relic dashboard PDF or image programmatically.

Installation

This is available on the Python Package Index (PyPI). You can install using pip.

virtualenv env
source env/bin/activate
pip install nrde

To install the development version, run:

pip install https://github.com/AnthonyBloomer/dashboard-exporter/archive/dev.zip

Usage

The first step is export your Personal API Key as an environment variable.

export NEW_RELIC_PERSONAL_API_KEY = "YOUR_API_KEY"

If you have an EU based account, you will also need to export the NEW_RELIC_REGION environment variable:

export NEW_RELIC_REGION = "EU"

Then pass the GUID of a given Dashboard to the exporter function to download a snapshot of your dashboard. You can get the GUID by pressing the info button in your dashboard.

import os
import time

from dashboard_exporter import exporter
import mimetypes

output = exporter(guid="The New Relic Dashboard GUID", file_type="PDF",)

content_type = output.headers["content-type"]
extension = mimetypes.guess_extension(content_type)

output_directory = os.getcwd()
filename = int(time.time())

of = "%s/%s%s" % (output_directory, filename, extension)

with open(of, "wb") as f:
    f.write(output.content)
    f.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nrde-0.2.0.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nrde-0.2.0-py2.py3-none-any.whl (2.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file nrde-0.2.0.tar.gz.

File metadata

  • Download URL: nrde-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for nrde-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3ef1cae305dddb17944cf56fb101eaf0fcc05f6e5b593e2e515bac0e42270712
MD5 10e19337725d7023e3e95d11953a4312
BLAKE2b-256 ee8fbd6e9d427460ff2a482f538af27e1a247c3d31f30f3e7654698b01866800

See more details on using hashes here.

File details

Details for the file nrde-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: nrde-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.7

File hashes

Hashes for nrde-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b2a6f2b43b62eb347465ba515cbaa973d48eae5da37e3a3b465066ed44ff8991
MD5 09a9a1d10142eb5e153301de3bee0a91
BLAKE2b-256 4790b2aaa80daa7e1ad8cac1b278a593b243f8a2d6fd932ee4192b149a46ef8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page