Add more static instance labels in prometheus config

I’m adding serves to my prometheus config like this:

  - job_name: cluster1
    static_configs:
      - targets:
        - server1.example.com
        - server2.example.com
        - server3.example.com

but now I would like to label the instances with additional static labels, like the server1 and server2 with “database” and server3 with “mail” and maybe server1 additionally with “mysql” and server2 with “postgres”.

I would then like to use this labels in grafana to filter on like here:

free_space_in_bytes{job=~'$job', server_type='database', database_type='mysql' }

Is this achievable within the prometheus config? Filtering on the jobname or instance is indeed possible, but I would like to extend this to more labels.

I found out in the meantime, that you can do it with just


    - targets:
        - server1.example.com
    - targets:
        - server2.example.com
       labels:
         - server_type: 'mail'
    - targets: 
        - server3.example.com
       labels:
         - server_type: 'database'

but you have to create an extra targets section for each instance then, thats why I ran in parsing problems before