<p>I want to monitor my MongoDb with prometheus. I currently have my MongoDb deployed like this</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-deployment
  labels:
    app: mongodb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mongodb
  template:
    metadata:
      labels:
        app: mongodb
    spec:
      containers:
      - name: mongodb
        image: mongo
        ports:
        - containerPort: 27017
        env:
        # These variables, used in conjunction, create a new user and set that user's password (From Mongo Docker Image)
        - name: MONGO_INITDB_ROOT_USERNAME
          valueFrom:
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-username
        - name: MONGO_INITDB_ROOT_PASSWORD
          valueFrom: 
            secretKeyRef:
              name: mongodb-secret
              key: mongo-root-password
</code></pre>
<p>and this service</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
name: mongodb-service
spec:
selector:
    app: mongodb
ports:
    - protocol: TCP
    port: 27017
    targetPort: 27017
</code></pre>
<p>And I installed prometheus via helm
<code>helm install stable/prometheus-operator</code></p>
<p>I know about this MongoDb Helm chart <code>https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-mongodb-exporter</code>. But to my understanding, this installs MongoDb and the MongoDb Exporter, so because I have MongoDb already setup, this is of no use for me, right?</p>
<p>What are the steps to install only the Mongo Exporter and connect it with my Mongo Database? All I know is, I need to create a <code>ServiceMonitor</code> that has a label of <code>release: prometheus-operator-1602753506</code>.</p>
<p>Sorry for this beginner question, I'm still very new to kubernetes and helm, so I'm quite confused at this point</p>

<p>The helm chart does not install mongodb, it requires some configurations to be able to connect to mongodb and pull metrics from it. Also it's stated that the helm chart comes with its own service monitor so you don't need to create a new one:</p>
<p><a href="https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-mongodb-exporter#service-monitor" rel="nofollow noreferrer">https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-mongodb-exporter#service-monitor</a></p>
