Actuator Info Not Working

0 views
Skip to first unread message

Trudi Miranda

unread,
Aug 5, 2024, 4:20:52 AM8/5/24
to guigrovylul
Inthis tutorial, we plan to learn about Spring Boot Actuator and how to add custom information to the /info endpoint. We will need Java 17 or higher, Maven, and your favorite IDE as a prerequisite.

Spring Boot Actuator is a Spring Framework sub-project. It allows us to monitor our application, get information about the project, gather metrics, or just check the state of our application/database.


A very convenient part of the Actuator is that it provides all support out of the box without any additional configuration. All we need to do to access all the information is to add the following dependency in our pom.xml file:


After adding the actuator dependency, the only remaining step is to enable the endpoints provided by it. Spring boot can provide information to any target type, such as JMX or Web. To use an endpoint:


Now we can check the endpoint at the following path: /actuator/info. And we will see the following empty response by default because we did not configure any properties for the /info endpoint.


All we need to do is to prefix the name of the property with info.". We can also group the properties, giving them the same prefixes. We can see below how we added three new pieces of information to our endpoint: the name of the project, the description, and the organization name.


We can add build information and additional properties to our /info endpoint using Spring Boot Maven Plugin. Spring Boot Actuator will show build details if a proper META-INF/build-info.properties file is present.


This Spring boot tutorial examined various methods to add custom data to our /info endpoint. This endpoint may provide very useful information about our project but may also be a sensitive endpoint that should not be exposed to everyone.


In a distributed, fast-paced environment, dev teams often want to find out at what time they deployed the app, what version of the app they deployed, what Git commit was deployed, and more.


Spring Boot Actuator is a sub-project of Spring Boot. In this section, we will quickly see how to bootstrap the sample project and enable the /info endpoint. If you want to know more about Spring Boot Actuator, there is already a great tutorial.


After the project is built we will expose the built-in /info endpoint over HTTP.By default the /info web endpoint is disabled. We can simply enable it by adding the the management.endpoints.web.exposure.include property in the application.properties configuration:


Adding useful build information helps to quickly identify the build artifact name, version, time created, etc. It could come in handy to check if the team deployed the relevant version of the app. Spring Boot allows easy ways to add this using Maven or Gradle build plugins.


The Spring Boot Maven Plugin comes bundled with plenty of useful features such as creating executable jar or war archives, running the application, etc. It also provides a way to add application build info.


If we sync the Gradle project now, we can see a new task bootBuildInfo is available for use. Running the task will generate similar build/resources/main/META-INF/build-info.properties file with build info (derived from the project). Using the DSL we can customize existing values or add new properties:


Time to run the app using ./gradlew bootRun (for macOS/Linux) or gradlew.bat bootRun (for Windows) command. Once the app is running, we can open the :8080/actuator/info endpoint in the browser and find the response as:


Git information comes handy to quickly identify if the relevant code is present in production or if the distributed deployments are in sync with expectations. Spring Boot can easily include Git properties in the Actuator endpoint using the Maven and Gradle plugins.


Using this plugin we can generate a git.properties file. The presence of this file will auto-configure the GitProperties bean to be used by the GitInfoContributor bean to collate relevant information.


In this article, we learned how to use Spring Actuator to expose relevant information about our application. We found out how information about the build, environment, Git, and Java environment can be added to the Actuator /info endpoint. We also looked at how all this information can be configured and controlled by the Maven/Gradle build plugins.


There are also some specialty devices of this type for use as door openers, even for quite heavy doors. they come in models for sliding patio doors, residential swing doors, gate openers, etc. Olide is a good brand. You have to look for the specific models that come with the Alexa integration built in.


Get More Done PRODUCT HIGHLIGHTS 2 NO or NC relays to turn almost any load into a Z-Wave device (use either the normally closed or normally open relay for R1 and R2 at a time) 2 Dry Contact or 12-24 V inputs to monitor...


The important details would be, whether the particular actuator has built-in limit switches, and if it is the 2-wire type, which allows for reverse polarity operation. Also, of course, if you are using a Smartthings Hub.


I am trying to slide open and slide closed a 2-feet wide by 4-feet high, 3/4 inch thick plywood door, with same size 1/4 inch thick mirror glued to front of plywood door, mounted on wall.

The door is connected to wall with 24 inch in length heavy duty drawer slides which allow the door to slide horizontally on wall. I would like this door to automatically slide open and close by using a Smart on/off receptacle of some kind for power or if there is a Smart working actuator of some kind, which can open and close with Alexa voice commands.


Olide is from a Chinese company (Chimentech) that specializes in automatic door and window closers. They sell to a lot of small businesses and warehouses as well as individual customers. They have a reputation for terrible documentation but really good US customer service by email. I have had a couple of friends get their products and been pleasantly surprised at the quality of support they received.


MHCOZY 2 Channel 5V 12V ZigBee Smart Relay Switch,Adjustable Self Lock and Momentary Interlock Working Mode,Works with Philips Hue, SmartThings, Alexa, Google Home (ZigBee Hub Required) - - Amazon.com


This second link is to the WiFi version, which from my understanding the eWelink WiFi version would be the easiest to have working without a Zigbee hub, although I think it would require the eWelink app initially, before subsequently configuring for Alexa.


You will notice that the relay has a USB port on one end, and that is what I would use for your initial testing. That will be the power that keeps keeps the relay on, but not what provides power to the actuator. The actuator power will be provided by an additonal 12v power adapter and connected to the relay/switch end.


So, I at least wanted to share some details on the relays. The instructions that come are a little thin. I imagine the eWelink Wifi version has some more details on connecting to the eWelink app, and maybe some info on getting the relay working with Alexa, afterwards.


Hello all! Pretty new to Arduino and circuits and I'd love some help on this circuit I am working on. I am using the Arduino MKR GSM 1400 board which is 3.3V ( -gsm-1400). I am used to 5V boards so I don't want to mess this up. I also got the MKR Relay Proto shield which is also 3.3V ( -relay-proto-shield). I needed a 2 channel relay to move a 12V powered actuator in or out. I have the code completed and working when ran via the serial console. I am outputting messages as needed, so I am good there and confident in the sketch.


This is for a project I was hired to program on the web with this physical circuit as an element of the entire system. I unfortunately cannot share the code due to the nature of the project. I can share a few stripped down elements of it so you get the gist.


"Closed loop" is a feedback amplifier term that has no meaning in this context.

If that's your noobie way of asking if the actuator 12V circuit is a closed circuit, then yes , of course it is.

(if you wire it as you say you did)

The relay board will not protect the MCU. The relay board will simply power the relays from the MCU signals.

There is no relay 12V.

The 12V is only connected to the actuator and does not connect to the MCU driving the relay board because it is NOT relay power, is it ?

It is the ACTUATOR power, and is only connected to the actuator, is it not ?


The system will not work without common grounds. All devices in the circuit should share the same ground

unless the relay board you purchased is opto isolated,

relay shield schematic

Judging from the schematic, I don't see any opto isolation. I see mosfets driven from 3.3V signals that sink the

current for the relays which run on 3.3V power. The contacts are of course not connected to anything on the

board, so there is that isolation.

You definitely don't want to connect 5V to a 3.3V relay board. No way.

I don't see what the 12V power has to do with anything on the board or the MCUs or anything else for that

matter since it is only connected to your actuator.


If you posted the truth table as requested , it would be obvious that either relay can make it go

forward or reverse, since those terms simply denote K1 pos/k2 neg or k1 neg/k2 pos. where 'neg' means

common connected to 12V return (-) and 'pos' denotes common connected to 12V +.

Point being that neither relay is in any way dedicated to a particular direction.

I would simply call those pins 'K1' and 'K2' , and post the Truth Table in your comment section and leave

it up to them to figure out what to do with them.

I'm only saying this because by your terminology, forward+ reverses= OFF

I didn't see anything in the code indicating that these are complimentary.

If you are intent on keeping the code as it is you should at least define the states:

i.e.


Correct. 12V wall adapter is only for the actuator. MCU power is provided separately from the USB cord.

Sorry I don't know enough about truth tables to make one. The code has been tested and even worked well with a similar system I made 2 years ago (with the Linkit One). But in that system, the board was 5V and there was an external 5V 2 channel relay that I used. I just had to upgrade the system to use the newer GSM bands since the old was on 2g only and that is no longer available. The MKR GSM 1400 gives me the new capability and I thought the relay shield would be more helpful than an external relay. Just trying to figure out how to set up the new system correctly before I plug it all in. Again, I really appreciate the help and sorry for being a super noob. I guess this is how I continue to learn!

3a8082e126
Reply all
Reply to author
Forward
0 new messages