Prometheus Deployer properties for Scrape - spring-cloud-dataflow

I noticed that my app running in Kubernetes doesn't actually get registered in grafana unless I add the following deployer properties:
deployer.*.kubernetes.podAnnotations=prometheus.io/path:/actuator/prometheus,prometheus.io/port:8080,prometheus.io/scrape:true
Is that supposed to be the case? If so, how can I add add these deployer properties to always be there for every deployment without having to manually add it in the Freetext section before deployment.

Thank you! That helped me track down the answer. I tried putting those properties in (and I might have messed up putting them in) but they kept showing up as app properties and not deployer properties. Then I tried something very similar in the skipper config:
data:
application.yaml: |-
spring:
cloud:
skipper:
server:
platform:
kubernetes:
accounts:
default:
podAnnotations: 'prometheus.io/path:/actuator/prometheus,prometheus.io/port:8080,prometheus.io/scrape:true'
...
And it worked beautifully. Sabby, thanks again!

What you're attempting to accomplish can be solved with the help of "global" property configuration in SCDF.
See: Common Application Properties
However, please note that this method will apply the desired configurations to every stream application that SCDF deploys on the targeted platform. IMO, it is a valid use of it since you'd need metrics scraping for all the deployed apps anyway.
Also, as a FYI, a similar property is available for Task apps.

Related

deploy non-nextjs edge-runtime to vercel

Recently I've been playing around with the edge-runtime and finally set things to work normally on my local environment with different routes path handled by some of my custom implementations under fetch event. and these are running under edge-runtime
And with some digging around, to be able to deploy what I've made to Vercel I have to convert my project to nextjs and exposed the config to ensure it to run on the experimental-edge runtime
What I want to ask here is
Is there a way I can deploy my edge-runtime API to Vercel without having to convert my project to NextJS
Thank you
No, Next is required.
use Cloudflare Workers instead for legacy fetch handler support

How to set Recovery options in Windows services using SaltStack

I'm creating a custom Windows Service and deploying it on my salt-minions using Salt master.
The code for it is as follows:
create_service_{{servicename}}:
module.run:
- name: service.create
- m_name: {{servicename}}
- bin_path: {{deploydir}}\path-to-service\{{servicename}}\{{servicename}}.exe
- display_name: {{servicename}}
- start_type: auto
- onfail:
- module: availibility_of_service_{{servicename}}
The service is getting created and deployed on all the minions as required however, I also want to set the recovery options via Salt as highlighted in the below screenshot. The below screenshot is just for reference and my actual service is a different one.
I tried finding salt commands to set this but couldn't. Can someone help me in this if I can set this to Restart via salt or its not available?
If this isn't available via Salt then what is the other option?
You will need to use powershell for that. the issue is the the function salt uses to handle creating the service doesn't handle that functionality. in fact the only way to change that functionality in windows is with the sc command.
see https://evotec.xyz/set-service-recovery-options-powershell/ for information on what to do to change those settings programmatically.

Is it not recommended to use Spring Cloud LoadBalancer's default cache on production?

Spring Boot version 2.5.2
spring-cloud version 2020.0.3
WARNING at the time of application startup --
2021-07-10 12:30:58.286 WARN 21316 --- [ main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
Why this log line is printed as Warning? Is it bad to use Spring Cloud LoadBalancer's default cache?
The answer is provided in this GitHub issue spring-cloud 1050
More specifically this explanation can help you understand if it's bad to use the default cache or not, based on your project:
I would say Caffeine has definitely been much more used and tested in production, while the default solution, which at this point is Evictor, is a solution based on a ConcurrentMap implemented as a hash-map with added TTL support. I would recommend using Caffeine in a production application. However, if you would like to stick to the default solution, you would need to consider if based on the predicted cache entry volume and the TTL settings that you would be applying, a concurrent HashMap would be enough.

Add a URL path prefix to artifactory installation (Docker)

I'm running Artifactory CPP CE 7.7.3 and Traefik v2.2 using docker-compose. The service is only available over http://localhost/ui/. Now, what I need is an option which allows to add a URL path-prefix (e. g. http://localhost/artifactroy/ui).
My Setup
I used the described setup process from the Artifactory Docs suggest it.
My docker.compose.yaml is the official extracted from the jfrog-artifactory-cpp-ce-7.7.3-compose.tar.gz: ./templates/docker-compose.yaml.
I'm using a reverse proxy (traefik). For this, I've added the necessary traefik configuration lines to the docker-compose-file. Here is a small extract what I've added:
[...]
labels:
- "traefik.http.routers.artifactory.rule=Host(`localhost`) && PathPrefix(`/ui`)"
- "traefik.http.routers.artifactory.middlewares=artifactory-stripprefix"
- "traefik.http.middlewares.artifactory-stripprefix.stripprefix.prefixes=/"
- "traefik.http.services.artifactory.loadbalancer.server.port=8082"
With this I managed to access artifactory over http://localhost/ui/.
Problem:
I have multiple small services running on my server, each of this service is accusable via http://localhost/<service-name>. This is very convenient and want to make clear that this URL is related to this service on my production server.
Because of this, I want to have an URL like http://localhost/artifactroy/ui/... instead of http://localhost/ui/...
I struggled getting artifactory setup in that way. I already managed to get a redirection from typing e. g. http://localhost/artifactroy/ to http://localhost/ui/ but this is not what I want on my production server.
What I did
Went through the documentation in hope of finding an option which I just can passt to artifactroy to add a prefix (Not successful).
Tried configure traefik two full days, to alter headers to get the repose point to http://localhost/artifactroy/ui/... (Only partially successful, redirection didn’t work afterwards)
Tried finding the configuration which is responsible for configure artifactory in $JFROG_HOME/artifactory/var/etc (Not successful)
Is this even possible? Help is highly appreciated..
This example (even though not traefic example) gives you a direction to implement it. There are certain routes already used within the product. You need to add a context over and above it to ensure all comes via the new context path.
https://jfrog.com/knowledge-base/how-to-remove-artifactory-from-the-context-url-in-artifactory-7/

Spring Cloud Config Server - Where to set encrypt.key to enable /encrypt endpoint

I have a Spring Cloud Config app with the Spring Cloud Security dependencies. I'm trying to hit the /encrypt endpoint to encrypt a password.
According to the docs at http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_key_management I believe I need to set a symmetric key using "encrypt.key". But I can't figure out where to put this; all combinations I've tried result in {"description":"No key was installed for encryption service","status":"NO_KEY"} when I attempt to POST to /encrypt.
If I POST a key to /key, the /encrypt works perfectly, so I'm pretty sure that everything else is setup correctly. It also works fine using the environment variable ENCRYPT_KEY, or by using a system property encrypt.key. I just can't figure out where to place the encrypt.key within a configuration file. Is there a sample on this?
Thanks #pVilaca, this is indeed what the documentation says, but setting the key in application.properties or application.yml won't work.
Through experimentation I've found that the only place you can set the encrypt.key property is an ENCRYPT_KEY environment variable, a system property, bootstrap.properties, bootstrap.yml, or calling the /key endpoint.
Not sure why application.properties or application.yml don't work in this case. Setting this key must have more of an impact on the startup process than it would appear.
Setting Spring Cloud Version to 'Brixton.SR5' worked for me. For some reason, setting 'encrypt.key' in either application.properties/yml or bootstrap.properties/yml in later Spring Cloud Version does not work anymore.
check properties tag of pom.xml file. If you are using version 2 or 3 of Dalston, change it to:
<spring-cloud.version>Dalston.SR1</spring-cloud.version>
and it should be working fine. In my case i was using version 3 and changing it to version 1 resolved the issue for me.
Reference:
https://github.com/spring-cloud/spring-cloud-config/issues/767
If you're using spring cloud with spring boot, that is the method that is described on the documentation that you mentioned, you've two 'main' properties files.
bootstrap.[properties,yml]
To modify the startup behaviour you can change the location of the config server using bootstrap.properties (like application.properties but for the bootstrap phase of an application context)
application.[properties,yml]
where the "application" is injected as the "spring.config.name" in the SpringApplication (i.e. what is normally "application" in a regular Spring Boot app)
source: Spring Cloud Config Documentation
So, it should be enough to set the encrypt.keyin your application.[properties,yml] file (or the alternative name if specified)

Resources