# Any label in namespace for apm-server 8.0.1

**URL:** <https://discuss.elastic.co/t/any-label-in-namespace-for-apm-server-8-0-1/298737>\
**Category:** APM\
**Tags:** docker, server\
**Created:** [March 3, 2022, 11:56am UTC](https://discuss.elastic.co/t/any-label-in-namespace-for-apm-server-8-0-1/298737 "2022-03-03T11:56:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![b2ron](https://avatars.discourse-cdn.com/v4/letter/b/e495f1/32.png) [@b2ron](https://discuss.elastic.co/u/b2ron)\
**Post date:** [March 3, 2022, 11:56am UTC](https://discuss.elastic.co/t/any-label-in-namespace-for-apm-server-8-0-1/298737/1 "2022-03-03T11:56:50Z")

</div>

Installed Elasticsearch via the Elasticsearch (ECK) Operator 2.0.0.  
Elasticsearch

```auto
  spec:
  auth: {}
  http:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate: {}
  monitoring:
    logs: {}
    metrics: {}
  nodeSets:
    - config:
        node.attr.attr_name: attr_value
        node.roles:
          - master
          - ingest
          - data
        node.store.allow_mmap: false
      count: 1
      name: default
      podTemplate:
        metadata:
          creationTimestamp: null
          labels:
            foo: bar
        spec:
          containers:
            - name: elasticsearch
              resources:
                limits:
                  cpu: '2'
                  memory: 4Gi
                requests:
                  cpu: '1'
                  memory: 4Gi
  transport:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate: {}
  updateStrategy:
    changeBudget: {}
  version: 8.0.1

```

kibana

```auto
spec:
  count: 1
  elasticsearchRef:
    name: elasticsearch-sample
  enterpriseSearchRef:
    name: ''
  http:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate: {}
  monitoring:
    logs: {}
    metrics: {}
  podTemplate:
    metadata:
      creationTimestamp: null
      labels:
        foo: bar
    spec:
      containers:
        - name: kibana
          resources:
            limits:
              cpu: '2'
              memory: 2Gi
            requests:
              cpu: 500m
              memory: 1Gi
  version: 8.0.1

```

apm-server

```auto
spec:
  config:
    apm-server.data_streams.namespace: test333
  count: 1
  elasticsearchRef:
    name: elasticsearch-sample
  http:
    service:
      metadata: {}
      spec: {}
    tls:
      certificate: {}
  kibanaRef:
    name: kibana-sample
  podTemplate:
    metadata:
      creationTimestamp: null
    spec:
      containers: null
  version: 8.0.1

```

app - petclinic

```auto
  spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: test-application
      app.kubernetes.io/name: petclinic
  template:
    metadata:
      creationTimestamp: null
      labels:
        app.kubernetes.io/component: test-application
        app.kubernetes.io/name: petclinic
    spec:
      volumes:
        - name: elastic-apm-agent
          emptyDir: {}
      initContainers:
        - name: download-agent
          image: 'docker.elastic.co/observability/apm-agent-java:1.29.0'
          command:
            - cp
            - '-v'
            - /usr/agent/elastic-apm-agent.jar
            - /elastic/apm/agent
          resources: {}
          volumeMounts:
            - name: elastic-apm-agent
              mountPath: /elastic/apm/agent
          imagePullPolicy: IfNotPresent
      containers:
        - resources: {}
          name: petclinic
          env:
            - name: ELASTIC_APM_SERVER_URL
              value: 'https://apmserver-sample-apm-http:8200'
            - name: ELASTIC_APM_SERVICE_NAME
              value: petclinic
            - name: ELASTIC_APM_APPLICATION_PACKAGES
              value: org.springframework.samples.petclinic
            - name: ELASTIC_APM_ENVIRONMENT
              value: dev
            - name: JAVA_TOOL_OPTIONS
              value: '-javaagent:/elastic/apm/agent/elastic-apm-agent.jar'
            - name: KUBERNETES_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: ELASTIC_APM_VERIFY_SERVER_CERT
              value: 'false'
          ports:
            - name: petclinic-http
              containerPort: 8080
              protocol: TCP
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: elastic-apm-agent
              mountPath: /elastic/apm/agent
          terminationMessagePolicy: File
          image: 'arey/springboot-petclinic:latest'

```

and have a few questions

1. data\_stream.namespace="default" can't be changed. different configuration options do not work.  
 ![Screenshot_2](https://us1.discourse-cdn.com/elastic/original/3X/1/6/166e4c871a4e923fb7d06b15eba7aa21b89de98d.png)

2. how to make data\_stream.namespace equal to kubernetes.namespace or some additional field/label (example - PROJECT). in versions 7.x it was possible to do -

```auto
output.elasticsearch.index: "apm-%{[observer.version]}-%{[processor.event]}-%{[kubernetes.namespace]}-%{+yyyy.MM.dd}"

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2022, 7:57am UTC](https://discuss.elastic.co/t/any-label-in-namespace-for-apm-server-8-0-1/298737/2 "2022-03-24T07:57:36Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
