Skip to content

Metrics "application" field not sent to prometheus #27047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
vmartowicz opened this issue Aug 23, 2024 · 2 comments · Fixed by #27065
Closed
1 task done

Metrics "application" field not sent to prometheus #27047

vmartowicz opened this issue Aug 23, 2024 · 2 comments · Fixed by #27065

Comments

@vmartowicz
Copy link
Contributor

vmartowicz commented Aug 23, 2024

Overview of the issue

The field "application" is not send to prometheus

Motivation for or Use Case

the field is not send to prometheus so grafana queries are empty wich implies incorrect grafan dashbord

Reproduce the error
  1. checkout jhipster sample app
  2. run the docker compose monitoring
  3. run the app
  4. Check that mettrics with "appllication" field is not present in prometheus
Related issues
Suggest a Fix

I just need to add the following properties
management.metrics.tags.application: ${spring.application.name} in application.yml
Maybe is there a better way? using metric registry?

See below picture of prometheus before and after fix. We can that "application" is sent after the fix (first row in the capture)

prometheus

JHipster Version(s)

8.6.0

JHipster configuration
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "jhipsterSampleApplication",
    "blueprints": [],
    "buildTool": "maven",
    "cacheProvider": "ehcache",
    "clientFramework": "angular",
    "clientPackageManager": "npm",
    "clientTheme": "none",
    "clientThemeVariant": "",
    "clusteredHttpSession": false,
    "creationTimestamp": 1577000812973,
    "databaseType": "sql",
    "devDatabaseType": "h2Memory",
    "devServerPort": 9060,
    "dtoSuffix": "DTO",
    "embeddableLaunchScript": false,
    "enableGradleEnterprise": false,
    "enableHibernateCache": true,
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [
      "BankAccount",
      "Label",
      "Operation"
    ],
    "entitySuffix": "",
    "hibernateCache": "ehcache",
    "jhiPrefix": "jhi",
    "jhipsterVersion": "8.6.0",
    "languages": [
      "en"
    ],
    "messageBroker": false,
    "nativeLanguage": "en",
    "otherModules": [],
    "packageFolder": "io/github/jhipster/sample",
    "packageName": "io.github.jhipster.sample",
    "pages": [],
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": 8080,
    "serviceDiscoveryType": false,
    "skipCheckLengthOfIdentifier": false,
    "skipClient": false,
    "skipFakeData": false,
    "skipServer": false,
    "skipUserManagement": false,
    "testFrameworks": [
      "gatling",
      "cypress"
    ],
    "useCompass": false,
    "useSass": true,
    "websocket": false,
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment (build 21.0.2+13-58)
OpenJDK 64-Bit Server VM (build 21.0.2+13-58, mixed mode, sharing)

git version 2.34.1

node: v20.15.0
npm: 10.7.0

Docker version 27.1.2, build d01f264

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions
@ChangelogDate("20150805124838")
entity BankAccount {
  name String required
  balance BigDecimal required
}
@ChangelogDate("20150805124936")
entity Label {
  label String required minlength(3)
}
@ChangelogDate("20150805125054")
entity Operation {
  date Instant required
  description String
  amount BigDecimal required
}

relationship OneToMany {
  BankAccount{operation} to Operation
}
relationship ManyToOne {
  Operation{bankAccount(name)} to BankAccount{operation}
}
relationship ManyToMany {
  Operation{label(label)} to Label{operation}
}

search BankAccount, Label, Operation with no
paginate Operation with infinite-scroll

Browsers and Operating System
  • Checking this box is mandatory (this is just to show you read everything)
@mshima
Copy link
Member

mshima commented Aug 23, 2024

Can you contribute with a PR?

@vmartowicz
Copy link
Contributor Author

Yes I will do it and fix it with the yaml properties

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants