# Mongo metrics export via k8s Grafana agent operator

**URL:** <https://community.grafana.com/t/mongo-metrics-export-via-k8s-grafana-agent-operator/87433>\
**Category:** Grafana Alloy\
**Tags:** kubernetes\
**Created:** [May 11, 2023, 12:39am UTC](https://community.grafana.com/t/mongo-metrics-export-via-k8s-grafana-agent-operator/87433 "2023-05-11T00:39:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotsauce](https://avatars.discourse-cdn.com/v4/letter/h/13edae/32.png) [@hotsauce](https://community.grafana.com/u/hotsauce)\
**Post date:** [May 11, 2023, 12:39am UTC](https://community.grafana.com/t/mongo-metrics-export-via-k8s-grafana-agent-operator/87433/1 "2023-05-11T00:39:24Z")

</div>

Hi, I want to export metrics from a MongoDB replica set running in Kubernetes, and I want to see the metrics in Grafana Cloud.

I have the Kubernetes Grafana Agent running using the Kubernetes operator. I can see Kubelet metrics, pod metrics, etc.

I went ahead and set up an Integration CRD for mongodb. This is what the CRD looks like:

```auto
apiVersion: monitoring.grafana.com/v1alpha1
kind: Integration
metadata:
  creationTimestamp: "2023-05-11T00:01:26Z"
  labels:
    agent: grafana-agent
  name: mongodb-exporter
  namespace: metrics
  resourceVersion: "2645330"
  uid: 0f022cf6-1d64-4a46-ac84-7b641dcc7dd1
spec:
  config:
    mongodb_uri: <VALID_MONGODB_URI>
  name: mongodb
  type:
    allNodes: true
    unique: true

```

The `grafana-agent-0` and `grafana-agent-integration*` pods run properly, even after I restart these pods. Their logs show no errors.

But I cannot see any data in the MongoDB monitoring dashboards. Help please?

Other notes:

- I know the MongoDB URI is valid because I tested using that URI from another pod.
- As you can see in the CRD, I omitted `relabel_configs`, which the docs mark as necessary. Seems like the latest version of the agent does no longer accepts that config (including the value makes the `grafana-agent` pod error out).
