Hi @dgieselaar @JasonREC @simitt
I have an identical requirement.
I have set up the Elastic Stack version 8.7 in a self-managed manner. Here's my setup:
I'm running Docker on an AWS EC2 instance. Inside the Docker container, I have a 3-node cluster and Kibana. To achieve this, I referred to the docker-compose.yml file mentioned in the Elastic 8.7 documentation. Additionally, I've configured a Fleet server. As part of this configuration, I enabled the "APM integration" feature on the Kibana dashboard, which I'll refer to as "dev-apm-integration." This feature spawns an APM server on the same host, listening on port 8200.
In my Kubernetes cluster, I have multiple pods running different services. Let's consider two microservices running as pods:
my-service-1
my-service-2
To start both services, I use the following command:
java -javaagent:elastic-apm-agent-1.38.0.jar -Delastic.apm.server_url=https://<apm-server-host>:8200 -Delastic.apm.secret_token=<mytoken> -Delastic.apm.application_packages=<my-packge> -Delastic.apm.service_name=abhi-service-content -Delastic.apm.environment=<any-env-name> my-service-1.jar
java -javaagent:elastic-apm-agent-1.38.0.jar -Delastic.apm.server_url=https://<apm-server-host>:8200 -Delastic.apm.secret_token=<mytoken> -Delastic.apm.application_packages=<my-packge> -Delastic.apm.service_name=abhi-service-content -Delastic.apm.environment=<any-env-name> my-service-2.jar
Both services push data to the same APM server that is connected to the Fleet server. Even if I create separate spaces, such as "my-service-1-space" and "my-service-2-space," and modify the above commands (change elastic.apm.environment) accordingly, the data still gets sent to the same apm server and ultimately ends up in the same indices.
What I desire is to have different data streams for each service so that I can apply different ILM (Index Lifecycle Management) policies to the data. Here's how I expect the configuration to work:
For my-service-1: Data should go to log-my-service-1-apm, trace-my-service-1-apm, and metric-my-service-1-apm.
For my-service-2: Data should go to log-my-service-2-apm, trace-my-service-2-apm, and metric-my-service-2-apm.
I would greatly appreciate any guidance on how to achieve this configuration. Thank you.