Interested in Observability, Security, Performance and the details of Spring implementation,... let's check them out together 🎉🚀!
When started Web Development, I wished I could have found resources that pointed out the right way/best practice to use Spring components as well as how they're used in Production, how to secure, monitor, alert, and scale out with confidence. Now as a Spring Enthusiast and also a Certified Google Cloud Architect, it’s my pleasure to share my knowledge, my learning journey with you guys and hope we can learn them together ✨🥰.
Hello Linh, if prometheus is scraping metrics from collector and the collector has metrics from various services. how can I get the names of the services on prometheus/grafana? so that the dashboards will also contain names of the services
Hello i use grafana and prometheus but when i configure prometheus, i see this error connect: connection refused the stack are Docker Compose Java Spring Boot Gradle
Hi! I saw that the Loki exporter for OpenTelemetry is deprecated. Could you update your video or provide guidance on how to send logs from OpenTelemetry Collector to Loki using a supported method? Any tips or new configurations would be really helpful! Thanks!
Tks for these 3 lesson how to use GraalVM Native Images series, although I dont know how to best practice this but i find it useful, broaden my knowledge. I am using maven so it takes me a long day to search and follow but finally I finished this series. Looking for more high technique, skills in the future
Hi I managed to add custom metrics to my spring actuator but I am unable to send them to my DD agent, I am trying to use built-in statsd as shown in spring documentation with no success
I understand that you're using 'io.micrometer:micrometer-registry-statsd'. Then making sure the connection is established between your application -> stastsd (by default, micrometer will send metrics to statsd at localhost:8125) , and disable `runtime metrics` of DD (DD_RUNTIME_METRICS_ENABLED=false). FYI: if your custom metrics are about latency, requestCount,... just simply use Java Agent in combination with stastsd, your traces will be sent and calculated into `trace metrics` that include your needs.
@@linhvudev Thank you for your quick response! I ended up using the spring actuator metrics I was missing just importing the 'io.micrometer:micrometer-registry-statsd'. Then I followed spring documentation and everything worked!
Sorry but after 3 minutes I was unable to finish the video. It's so diffucult to follow when you are skipping/changing letters in word like "Servid" instead of "Service" or "lient" instead of "client" (and you keep repeating these words many many times) or other like "lelved" instead of "level", "experiend" instead of "experience". I'm not sure why but you were able to pronounce "c" letter in "documentation" (and you are able to pronounce "s" letter as well) but you change it in all other words. I had to rewind the video few times and listen to it again but after 5 minutes I realized I'm still 3 minutes into the video. I believe this video is very informative but even on the weekend in my free time I don't have 1h to watch this video (with rewinding every 10 seconds because I didn't get what you are saying). Before anyone says "chill dude, it's his accent, he is not a native speaker". Well, me too as you can notice by reading this comment (I bet I did some mistakes) but you were able to follow my message till this sentence which means it's good enough to understand me. It's a honest opinion about the video. He can try to improve next time and someone had to say it. Cheers
hi a, cho em hỏi em muốn deploy ứng dụng spring boot lên 2 gke khác region, và sẽ có 2 tầng load balancer, tầng 1 sẽ điều hướng user ở vùng đó vào được gke gần nhất, và tầng 2 là load balancer trong internal từng gke, giả sử trong gke em scale instance lên multiple em research mà không rõ google cloud có support mô hình này không ạ?
Chào anh ạ, e cám ơn bài hướng dẫn của a về OpenTelemetry này. E cũng đang có 1 dự án tích hợp nó với Spring MVC mà exporter của nó là Jaeger với Elasticsearch/Kibana, và tương lai sẽ đổ data tracing từ Jaeger và customize data đó trong Kibana dashboard ạ. Anh có thể hướng dẫn 1 ít về cách sử dụng đổ data về Jaeger và từ Jaeger sẽ customize tới Kibana dashboard được không ạ.
Hi everyone, sorry for late watching the videos. I have a question, i hope you will answer)) I did it exactly like you but I couldnt find OpenTelemetryAppender class in anywhere? this class cannot be imported. If anyone know th solution, then plz let me know!!!
you should try to use that exactly version 1.29.0 for each dependencies io.opentelemetry and for io.opentelemetry.instrumentation must have -alpha behind
Hi, I want to publish some database state metrics (for example some business data). It can be achieved by using @Scheduled annotation and perform query which will fetch statistics and register them in MeterRegistry. But I'm not sure if using scheduler for that is good idea. Is there a better way to do that?
I fell a little behind watching your videos - but I catch up now. Retry is another wonderful, advanced topic. Thanks for sharing. One little recommendation - as I see you always struggling to import classes manually when adding/uncommenting code. I used to do that too for years. But there is a setting in IntelliJ: Enable "Add unambiguous imports" (and maybe Optimize imports) in Settings>Editor>General>AutoImport 😄
Hi Linh, Do we need to have the postgres installed on our local machine, before doing this development. Thanks for your valuable information on the OTEL using Java SDK.
personally, I always prefer using docker instead of installing locally, we can start/shutdown whenever we want, be flexible to use different versions of postgres,...
Hi, your videos are amazing, but I'm facing an issue with my Spring Boot app deployed on a Cloud Run service in GCP. When it's deployed, the JPA and Hikari pool start up fine, but they shut down abruptly after a second. A few minutes later, I can't make any more requests because both instances have shut down unexpectedly. I need help, please.
For a normal Spring Boot app, it'll create 10 connections in its pool, and you can check your CloudSQL metrics to see whether 10 connections being acquired. if you're using the lowest-price CloudSQL as in the video, probably you reached to connection limit of CloudSQL, especially if you were running multiple instances of Cloud Run.
Thanks for sharing. Nice explanation. Can we order the build information. I am wondering if there is any option to display build information first and all other information below that.
Finally, I could find solid info about RestClient. But I'm wondering if I use several different restclient beans, how do I register interceptor for each of them at once instead of duplicating .requestInterceptor() method call?
how about creating a separated method receiving a RestClientBuilder and returning a RestClient, so every time you inject a RestClientBuilder, call this method to build up a RestClient.
It's a Good KT, I have an issue with exporting "Actuator" traces to zipkin and jaeger somehow I don't see any info in zipkin & jaeger UI, I would really great to hear from you
I have use the latest image of otel/opentelemetry-collector-contrib that seems a problem, then I switched to otel/opentelemetry-collector-contrib:0.82.0 not it works
Nice video, thanks for it! Would you recommend retry for when the system throws write conflict exception when 2 service classes try to update the same document in mongodb database within @Transactional methods (with mongotransaction enabled) ? If no, would you have another suggestion on how to handle those cases? Thanks!
thank you! For your question, honestly, I don't get it, you let your own 2 classes update the same document in one transaction, so even you try to retry, it's gonna happen again. Usually stateful retry is used when, for example, in one transaction, you first create 1 invoice(successful) then you update a order(failed), so if you're using stateless retry, your method will run again then it will create 1 another invoice and update update a order, so you'll end up with 2 invoices. This is where you need stateful. But personally, I prefer accepting errors and let's client do another request again, just like we usually do with requests so far.
Hey I have a question while doing this we need a otel collector and promethues up and running on top of java agent which will instrument java metrics and it will be collected by otel collector and it getting pushed to prometheus correct
let's take a look at the diagram, you'll see the arrow from hello-service to collector, it means service "pushes" metrics to collector. On the other side, the arrow is from prometheus to collector, it means prometheus "pulls" (scrape) metrics from collector. Hope it will help you in later videos!
Nice question! It simply depends on your interceptor can be shared across multiple RestClient instances (if you have multiple RestClient instances). For example: all RestClient instances intercept a request to add a same headers to downstream services => you can register 1 interceptor bean and inject it to all instances. But if your interceptor behaves different for every services, new Interceptor(String hiServiceToken) for HiService, new Interceptor(String helloServiceToken) for HelloService => you need to create 1 interceptor instance for 1 RestClient instance. Avoid making stateful interceptors, it's a different story, anyway, yeah, understand what you're using.
@@matsior_ yes, it absolutely is, RestClient.interceptor is WebClient.filter in Reactive context. In Reactive, you'll have ServerOAuth2AuthorizedClientExchangeFilterFunction is already supported. But the similar thing in RestClient is being developed, an issue was raised nearly a year ago github.com/spring-projects/spring-security/issues/13588, an draft version is also discussed there, you could take a look.
Your video is cool, but please explain to me in a productive environment how to use this? It doesn't make sense to use gcloud because this is for a common user, how do I apply this in production so that someone can connect to the db. without having to use gcloud, think about a large team
thank you for leaving your question, this is not for common users, this is for developer team checking their database, both of them have their own google account. I think you're asking for business team, right? Then it's a different story, you obviously don't want them to touch your database, and they neither. This case, you may want to streamline your data to BigQuery, visualize them onto Looker Studio (under Dashboards, or even Database tables) and then share your Dashboard to them. Hope this give you an overview of Google Cloud infrastructure.
Hi Linh Vu, I really wanted to say big thanks for your amazing videos about Observability. One questions bothers me though. In the previous videos, you used otel-collectors as part of Micrometer project from Gradle. Here, you are using it as a javaagent. I'm kinda confused when to use each one, in which cases? Thanks in advance.
thanks for your nice words about the Observability series Marko. It seemed like we really have 2 options for auto-instrumentation: instrument-library and java-agent, but in most cases, you can easily/have to choose one option. For example, if you're Devops, you probably will stick with java-agent,... it also depends on your Observability vendor, Datadog only provides the java-agent for auto-instrumentation, OpenTelemetry is also supported by Datadog but requires setting up more things and fewer functionalities. I also refer to a post of Jonatan Ivanov(he works in Micrometer) in one of the comments below, hope you find something useful.
@@linhvudev Thanks man for your thorough explanation. I really appreciate, keep up a good work. P.S. since I'm also really interested in Security, I saw your videos about Security as well. One suggestion, try Spring Authorization Server and perhaps make some videos about it. Cheers
@@markostrisko2370 thank you, yeah, I really want to share my exp with Spring Authorization Server as well, many things to talk about it, add SAML, PCKE, best practices like BFF, Token-Mediating,... but really need time to arrange the content, so I put it off at the moment, however I'll be back with the series as soon as possible.
Again, my friend, such great content! Unlike many other channels, you manage to present rather advanced Spring topics in a very clear way, making it easy and a pleasure to follow. I repeat myself, but each vid I learn something new, though I know myself a thing or two here :-). My highlight here were the ClientRequestFactories and its Spring support as Settings class. Did not know about it..