Hide build info from Actuator Info Spring boot - java

Currently, I'm getting build info and build info from the Actuator/info endpoint. Like
{
"git": {
"commit": {
"time": "2021-09-01T05:56:49Z",
"id": "XXXXXX"
},
"branch": "task/XXXX-1234-adding-actuator-endpoint"
},
"build": {
"version": "0.0.1-SNAPSHOT",
"artifact": "XXXXX-XXXX",
"name": "XXXX---XXXX",
"group": "no.XXX.XXX",
"time": "2021-09-01T07:18:23.786Z"
}
}
What I need to do is hide build info from this, is that possible with the Gradle actuator for spring-boot? I only need to get git info.

As per this: https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json line 249,
It should be as simple as management.info.build.enabled=false in your application.properties.

Related

Marketo API export lead job fails with "Invalid smartListId" error

We are trying to export leads via Bulk Lead Extract Marketo API endpoint using smartListId filter.
Create lead export job:
Enqueue lead export job:
The job fails with "Invalid smartListId 2017":
We are having trouble understanding what might be preventing this job from succeeding. The smart list in question does not seem to be special in any way:
GET {{endpoint}}/rest/asset/v1/smartList/2017.json?includeRules=true
{
"success": true,
"errors": [],
"requestId": "a435...9089f2",
"warnings": [],
"result": [
{
"id": 2017,
"name": "Sync Error",
"description": "jh",
"createdAt": "2018-07-18T20:20:22Z+0000",
"updatedAt": "2022-08-16T16:55:27Z+0000",
"url": "https://app-sj24.marketo.com/#SL2017A1LA1",
"folder": {
"id": 1010,
"type": "Program"
},
"workspace": "Default",
"rules": {
"filterMatchType": "all",
"triggers": [],
"filters": []
}
}
]
}
What could be the reason for this smart list not working with the bulk lead extraction endpoint?

Why the component I deploy to AWS Greengrass Core fails immediately after being deployed?

I have developed a component that subscribes to a local broker in my Greengrass core device and also subscribed to the device shadow of the core device and updates it with data coming from the local broker.
All good, it works for me locally before I deploy it but once deployed it crashes and in CloudWatch I can see the following errors:
{
"timestamp": "2022-04-22 20:25:49.139",
"logLevel": "ERROR",
"traceId": "05e6b233-1b52-d773-d061-3c74057655ea",
"accountId": "***********",
"status": "Failure",
"eventType": "GetThingShadow",
"protocol": "MQTT",
"deviceShadowName": "MyName",
"topicName": "$aws/things/MyName/shadow/name/AWSManagedGreengrassV2Deployment/get",
"details": "No shadow exists with name: 'MyName~AWSManagedGreengrassV2Deployment'"
}
The second one:
{
"timestamp": "2022-04-22 20:26:08.479",
"logLevel": "ERROR",
"accountId": "********",
"status": "Success",
"eventType": "UpdateJobExecution",
"protocol": "MQTT",
"clientId": "MyName",
"jobId": "d1a10592-7d03-4cc8-aeca-1a615dc562e0",
"topicName": "$aws/things/MyName/jobs/d1a10592-7d03-4cc8-aeca-1a615dc562e0/namespace-aws-gg-deployment/update",
"details": "The destination status is FAILED. The request status is SUCCESS."
}
What could cause these issues? Can somebody give me a clue?
I found an answer to my problem.
It was the fact that the component I deployed has a different Java version compared to the one that the Greengrass Core is running.
I hope that helps somebody.

How to deploy asynchronously an application using REST in weblogic 12C?

I have been deploying a weblogic application using the REST api with the following snippet
curl --insecure -X POST --user ${userpass} -F\"deployment=#${appFileName}\" -F\"model={name: '${appName}', deploymentOptions: { retireGracefully: 'false', timeout: '0' } , ${appType} ${appPlanVersion} targets: [ ${appTargets} ]}\" ${wlhost}/management/wls/latest/deployments/application "
I have to wait until this curl ends , but sometimes the request times out because of server configuration.
so, I thought it would be better to do this operation asynchronously, I have read in the documentation that I can use header
-X Prefer:respond-async
but is not clear how to use it, I was not able to find an useful example, once I have added the header, the request is going to return a task URL like
BODY:
{
"links": [{
"rel": "job",
"href": "http:\//localhost:7001/management/weblogic/latest/domainRuntime/deploymentManager/deploymentProgressObjects/fairShare"
}],
"operationType": 5,
"state": "STATE_RUNNING",
"applicationName": "fairShare",
"progress": "processing",
"completed": false
}
how do I poll that job URL to know that the application was deployed and is active ?
If you'll execute:
curl --insecure -X GET --user ${userpass} ${wlhost}/management/tenant-monitoring/applications/${appName}
when application ${appName} is not deployed, you should get 404 Not Found.
when it's deployed, you should get a JSON similar to this:
{
"body": {
"item": {
"name": "${appName}",
"type": "ear",
"state": "STATE_ACTIVE",
"health": "HEALTH_WARN",
"targetStates": [
{
"target": "wls",
"state": "STATE_ACTIVE"
}
],
"dataSources": [],
"workManagers": [
{
"pendingRequests": 0,
"completedRequests": 125,
"name": "default",
"server": "wls"
}
],
"minThreadsConstraints": [],
"maxThreadsConstraints": [],
"requestClasses": []
}
},
"messages": []
}
Tested (in Postman) on WebLogic 12.2.1.4
The answer is to use the request parameter _detached= true
in the post URL,
This will start the deployment asynchronously
for an example , refer to this document.
https://docs.oracle.com/middleware/1213/wls/WLRMR/management_wls_version_deployments_application.htm#WLRMR290

in graphite server - actuator/metrics/http.server.requests count not updating

I have a spring boot project up and running. I have also configured dependency for micrometer-registry-graphite in pom file. And I have installed graphite using docker (downloaded latest version - 1.1.6) and it is running in localhost:80
When I hit the below url it properly shows the hit count.
http://localhost:5080/api/v1/actuator/metrics/http.server.requests?tag=uri:/queue/{queueId}&tag=status:200
Below is the response,
{
"name": "http.server.requests",
"description": null,
"baseUnit": "milliseconds",
"measurements": [
{
"statistic": "COUNT",
"value": 29.0
},
{
"statistic": "TOTAL_TIME",
"value": 942.520949
},
{
"statistic": "MAX",
"value": 0.0
}
],
"availableTags": [
{
"tag": "exception",
"values": [
"None"
]
},
{
"tag": "method",
"values": [
"GET"
]
},
{
"tag": "outcome",
"values": [
"SUCCESS"
]
}
]
}
When I navigate to Graphite Browser, I'm not able to get the count value which I got previously using actuator/metrics url. [We can see the service's url queue/queueId is transformed to some hierarchy form].
And I can see different hierarchical structure (attached the image), why it is showing under exception, None and other unrelated hierarchy. Can someone please explain this and I'm in need of solution to get the hit count in graphite server.
Spring boot version: 2.2.4 RELEASE and
micrometer-registry-graphite version: 1.3.2
I have wrongly pointing my graphite server with port-80 in bootstrap.yml. But port-80 listening fo nginx, where it should point to port-2004 which is listening for carbon receiver. After this change in bootstrap.yml I'm able to resolve this issue.

Spring Boot : "Cannot set level: INFO, ERROR for 'org.springframework'" using logback-spring.xml

My application is running in V 1.5.10.RELEASE, to trace my logs in files, i was basically used the logback-spring.xml
When the handler catch and throw an exception of type "message": "java.lang.NullPointerException"
the error was badly reassembled :
{
"timestamp": "2019-11-12T10:59:58.124Z",
"timeZone": "Europe/Paris",
"level": "ERROR",
"env": "PRD",
"laas_apcode": "xxxx",
"laas_type": "service_logs",
"laas_retention": "quarter",
"laas_token": "0000000x",
"organizationalEntity": "xxxx",
"apName": "xxx-xxxx",
"apVersion": "0.4.9-1911",
"nodeName": "xxxx",
"labels": {
"userId": "",
"sourceIp": "",
"layer": "",
"rootCorrelationId": "",
"correlationId": "",
"parentCorrelationId": ""
},
"loggerName": "o.s.b.logging.LoggingApplicationListener",
"message": "Cannot set level: INFO, ERROR for 'org.springframework'",
"exception": {
"stackTrace": ""
}
}
in my application.yml i set this :
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO, ERROR
setting multiple levels on one package is not allowed
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO
this will show all message of level INFO, WARN, ERROR for package org.springframework
and all message of level WARN, ERROR for package your.package

Categories