168 questions
0
votes
1
answer
68
views
Unable to Connect to Grafana API via Python
I am looking for assistance in fixing my python script which uses Grafana API.
I have to create silences in Grafana using a master excel sheet provided to me which contains below details to create the ...
0
votes
0
answers
104
views
Grafana display metrics between chosen time range
I have an histogram metric which records time taken to execute a program. How do I display it in grafana that shows value recorded in specific time interval.
Scenario:
At t:0 to t5 the value recorded ...
0
votes
0
answers
90
views
Filtering does not work in the endpoint /alertmanager/grafana/api/v2/alert
I've tried a variety of approaches to filtering data, but none have worked. All attempts to get an alert for a given field (alert_rule_uid) were unsuccessful. Sample data:
"startsAt": "...
0
votes
0
answers
263
views
Why am I still seeing Grafana Live API calls despite setting max_connections to zero?
In my grafana helm values.yaml I have specified the following
grafana.ini:
live:
max_connections: 0
This is based on the documentation that says "0 disables Grafana Live".
I have ...
1
vote
1
answer
162
views
Using grafana operator, how can I create an Opensearch DataSource and set withCredentials = true in the Yaml?
I am using grafana operator to setup an Opensearch Datasource. According to the api documentation, the field cannot be set under the spec like this :
apiVersion: grafana.integreatly.org/v1beta1
kind: ...
0
votes
1
answer
50
views
Have a user access some values of a variable and not all of them in Grafana?
I have a dashboard in Grafana. I added a variable and it has a lot of values. I want to know if I can hide some of these values from some users. Meaning that some users can only see half of the values ...
1
vote
2
answers
545
views
Is there a way in prometheus to count how many records exists using promQl?
I have been using Prometheus as a data source in Grafana lately, but there are so many limitation to Prometheus. for example have a look at these records that exists in my localhost:9090 where ...
0
votes
1
answer
453
views
permission needed in setting of grafana API
I am using grafana API to fetch settings.
GET /api/admin/settings
Accept: application/json
Content-Type: application/json
Authorization: Bearer glsa_wFaOgY9XUHNCP3STz63hQNBwJelyvuIP_a3abc4d5
It ...
0
votes
0
answers
75
views
Grafana: Accessing Time Range from API?
I'm attempting to import the currently selected time range in a dashboard (in the upper right) into Python through the API.
From my understanding, the API can only retrieve the JSON of a dashboard, ...
1
vote
1
answer
818
views
Grafana with Infinity plugin with bearer token
I'm using the Infinity plugin for Grafana the problem is the api I am trying to use first requires me to get a bearer token.
For example using this CLI:
curl --location 'https://serverIpAddress/auth/...
0
votes
1
answer
769
views
Securing Grafana Alloy (OTel Collector) Endpoints [closed]
In my environment, Grafana Alloy is hosted and all LGTM Services are deployed and configured and connected to alloy. My alloy is exposed through nginx-ingress.
To Secure the endpoint now I am using a ...
0
votes
1
answer
1k
views
How to Remove TimeStamp column from grafana Table Visualisation
enter image description hereI'm using Prometheus and monitoring it through Grafana. However, whenever I write a PromQL query and check it in table visualization, it always shows me a timestamp column ...
-1
votes
2
answers
956
views
Automate Grafana Dashboard Creation
Currently I have created Grafana Dashboard manually. I have got the Json. I wanted to automate and I came across the Grafana HTTP API. https://grafana.com/docs/grafana/latest/developers/http_api/...
2
votes
0
answers
261
views
Templating Grafana HTTP request to query a data source via Python
I want to query a data source in Grafana via Python.
Following is the code I have come up with.
headers = {"Accept": "application/json",
"Content-Type": "...
0
votes
0
answers
91
views
Executing SQL commands through custom plugin
I am developing a plugin to get familar with the platform and make some proof of concepts. I am trying to execute SQL commands to a local postgres database directly in my plugin through a button ...
1
vote
0
answers
339
views
OTLP Collector to Graphana Cloud Tempo - 401
I have a OTLP instance running that collects traces successfully over grcp. But when I try to uplad the traces to my grafana cloud tempo instance I get this error:
grafana-collector-1 | 2023-12-...
0
votes
1
answer
776
views
How to programmatically copy a dashboard's layout to another in Grafana?
My goal is to programmatically duplicate a Grafana dashboard.
I couldn't find this feature in the API doc so I thought pasting dashboard1's JSON into dashboard2 would achieve the same results.
Here is ...
2
votes
1
answer
942
views
Grafana edit provisioned contact points
I want to provision contact-points to my Grafana in Kubernetes.
My config:
contact_points.yaml: |
apiVersion: 1
contactPoints:
- orgId: 1
name: telegram-alerts
...
0
votes
2
answers
1k
views
Can't provision Grafana dashboard with default permissions
I'm facing some problems when I'm trying to provision open source grafana dashboards running on docker container.
Dashboards are visible and working correctly, but for some reason they only have ...
1
vote
2
answers
5k
views
Set prometheus metric to return datetime instead of a float
self.add_metric(
prom.Gauge,
"date_to_catch",
"The timestamp when the event happened",
)
@property
def date_to_catch(self):
...
0
votes
1
answer
3k
views
Grafana API Keys option not available
The API option under Administration is not available for me, I am using docker image (grafana/grafana) installed on a VM.
[Image showing the said option not being there][1] [1]: https://i.sstatic....
0
votes
1
answer
1k
views
How to push Graphite metrics to Grafana Cloud with curl?
I'm trying to get a very simple example of pushing Graphite metrics to Grafana Cloud using their HTTP API to work.
This example comes straight from the Graphite HTTP API documentation:
user_id=<...
1
vote
0
answers
492
views
Grafana Alert deletion using file provisioning
Have anyone worked on alert rules using file provisioning ? like I am looking to delete an entire folder instead of deleting each alert one by one using its UID . the template I use to delete rule is ...
0
votes
0
answers
784
views
Trouble Updating Grafana Dashboard via API: Getting a 400 Response Error
I'm currently working on a script to update Grafana dashboards through the API, and I keep encountering issues when sending my JSON payload. Each time I make the request, I receive a <response 400&...
0
votes
1
answer
3k
views
How do I pass a variable that I created for a Grafana Dashboard as a body parameter for a JSON Query of a Grafana Visual?
I am using the Grafana Infinity Plugin to make GET/POST requests to get data from the URL of an API for a visualization on a dashboard.
For a particular POST request, it takes an input parameter ...
0
votes
1
answer
2k
views
How to import Grafana dashboard with Terraform?
I have multiple instances of Grafana. All instances should have the same dashboard. Therefore, I created the dashboard on one instance and exported it (see Export a dashboard). Now, I want to import ...
0
votes
1
answer
876
views
What to do with 500 error in Grafana Cloud API?
I'm trying to API query from Grafana Cloud.
I've got this JavaScript file:
const url = new URL('/<apache proxy>' + '/loki/api/v1/labels', window.location.origin);
const user = '<user>';
...
0
votes
1
answer
856
views
Exporting alerts json data using Grafana API in Grafana v10
I am using Grafana cloud v10.0.3 and could not find any way to exports alerts json data. I tried to write a python script to access alerts json data but it is not showing any output. Below is the ...
0
votes
0
answers
147
views
Credentials in JavaScript fetch()
I'm trying to query data from a Grafana Loki Cloud.
This works:
curl -s -G "https://<user>:<API key>@<site>.grafana.net/loki/api/v1/query_range" --data-urlencode 'query={...
3
votes
1
answer
1k
views
Not able to see Grafana Annotations
I am adding attonations to my grafana dashboard via the API api/annotations
with the request body:
{
"time": 167419909,
"tags": ["tag1", "tag2"],
"text&...
1
vote
0
answers
704
views
Grafana Loki HTTP API parameter "since"
I'm doing Grafana Loki HTTP API queries, specifically query_range ones which produce stream responses. The parameters listed for such queries are:
query
limit
start
end
since
direction
I've got 5 of ...
3
votes
1
answer
17k
views
Showing Memory utilization in Grafana dashboard
I have configured node exporter, grafana and prometheus through docker compose. I want to show Memory usage in the dashboard. I want to match the value shown with what is shown in the Ubuntu System ...
0
votes
1
answer
584
views
How to check health/query a Tempo datasource using the Grafana API - v9.1.6
I want to test the connectivity between Grafana(v9.1.6) and a Tempo datasource using the API. In the documentation, it appears that I can use the GET path /api/datasources/:datasourceId/health
(https:/...
0
votes
1
answer
4k
views
CORS in Grafana API [closed]
I want to enable cors on grafana so that I can make POST request on a react APP using grafana API. My issue is I can't set cors on grafana.
I have tried to edit the defaults.ini file for grafana but ...
2
votes
0
answers
1k
views
Grafana alert is created with new alerting provisioning api, but not actually working
I am creating an alert for grafana using this endpoint POST /api/v1/provisioning/alert-rules with the bellow request body. The created alert is shown in the UI, but on the health column it's showing ...
1
vote
1
answer
2k
views
Assigning permissions to Grafana dashboards in helm values.yaml
When I create a dashboard in Grafana and export it in JSON, the role, user and group permissions I define are not saved with it.
I am looking for a way to assign permissions for each dashboard in a ...
0
votes
1
answer
176
views
Grafana - Get paginated list of the Alert Rules
Does anybody know if there is a way to get a paginated list of the Alert Rules via the Grafana API. Specifically for Grafana versions 7.5.17 and 9.3.X
I found this endpoint for the version 9.3
/api/...
1
vote
0
answers
183
views
Pausing Grafana alerting rules from Mobile app (React Native) through Grafana API
I'm trying to use the grafana API to pause and unpause grafana alerts via a mobile app in React-Native and Expo. following the documentation, with postman, the states are changed correctly, but when I ...
0
votes
1
answer
2k
views
how to create graph in grafana using Json data?
I have a sample json & I'm using JSON API plugin as i'm getting data from API
{
"data": [
{
"timeStamp": "2022-07-28 12:00:00",
&...
0
votes
0
answers
1k
views
Grafana : Data source not automatically refreshing the query
Problem: When generating dashboard panels using Python Requests, unless the panel query is manually clicked ‘Run’ on Grafana UI, there is no data displayed.
Attached image shows how it does not ...
2
votes
1
answer
2k
views
Alerts repeating within minutes using Grafana Alerting
Using Grafana 9.2.2 with VictoriaMetrics as data source to send alerts when certain criteria is met.
Using an external service to deliver alerts by configuring an API as webhook contact point, over ...
1
vote
1
answer
3k
views
Querying loki logs using python
I am using the following script to query logs from loki which is running on some vm.I want to get the logs on multiple boxes and do some operation on them. so i am using loki as a source to get all ...
0
votes
1
answer
170
views
Grafana Dashboard not getting deleted through Grafana Delete API from NodeJS code
I was able to delete Grafana dashboard through its delete API from Postman but when I try deleting it through NodeJS code, it is not working. I get status as 200 from the code but the response body ...
1
vote
1
answer
4k
views
Grafana alert provisioning issue
I'd like to be able to provision alerts, and try to follow this instructions, but no luck!
OS Grafana version: 9.2.0 Running in Kubernetes
Steps that I take:
Created a new alert rule from UI.
Extract ...
1
vote
0
answers
2k
views
Grafana Alert migration (from Legacy to Unified-Alerting): How do I get/export alert-rules, contactPoints and policies in NEW format?
Edit: I also posted this question, which describes the problem in a much more concise manner. I feel I might be missing something basic, but I just don't know. Any help would be appreciated. Thanks.
...
12
votes
2
answers
15k
views
Grafana showing "too many outstanding requests" error while querying loki dashboard
I am trying to use loki and grafana for generating and visualizing log-based metrics. I have created a Grafana dashboard using the loki filters. While clicking the refresh button, all dashboards fail ...
1
vote
0
answers
2k
views
Grafana /api/dashboards/uid/ result miss datasource id
When I use grafana /api/dashboards/uid/xyz123 API, I get all definitions of dashboard xyz123, except the datasources’ ids. It returns dashboard json with “datasource”: null,
If I export it via GUI (...
0
votes
1
answer
391
views
How to delete a panel from grafana dashboard using python requests?
I am able to access dashboards using the following api call-
url2 = server + "/api/dashboards/uid/" + uid #uid of dashboard
r = requests.get(url=url2, headers=headers, verify=False)
From ...
0
votes
1
answer
2k
views
How do I update Grafana dashboard through it's API
I want to update the grafana dashboard through its API but i have found out 2 problems:
i got an 412 HTTP error {'message': 'A dashboard with the same name in the folder already exists', 'status': '...
0
votes
1
answer
2k
views
Grafana Alert Value String Templating
I'm creating a Grafana alert with the Elastic datasource. The condition operator is grouping all meaningful labels from my alert.
[ var='A0' metric='' labels={header_host=hostname1.com value=1496 ], [ ...