-
Using GCP recommender API for Compute engine
Let’s keep it short. If you want to use Python libraries for Recommender API, this is how you connect to your project. from google.cloud.recommender_v1beta1 import RecommenderClient from google.oauth2 import service_account def main(): credential = service_account.Credentials.from_service_account_file(‘account.json’) project = “internal-project” location = “europe-west1-b” recommender = ‘google.compute.instance.MachineTypeRecommender’ client = RecommenderClient(credentials=credential) name = client.recommender_path(project, location, recommender) elements = client.list_recommendations(name,page_size=4)…
-
ELK query using Python with time range
Short post. Sharing how you make an ELK query from Python using also timestamp: And that’s all! Cheers
-
Multiple field query in ELK from Python
Morning, There are a lot of pages on how to query ELK stack from Python client library, however, it’s still hard to grab a useful pattern. What I wanted is to translate some simple query in Kibana like redis.info.replication.role:master AND beat.hostname:*test AND tags:test into a useful Query DSL JSON. It’s worth mentioning that the Python…
-
My introduction to Linear Regression, so far
Morning, Here are some first steps that I want to share with you from my experience with regressions. I am new and I took it to step by step, so don’t expect anything new or either very complex. First thing, first, we started working on some prediction “algorithms” that should work with data available in…
-
Kafka_consumer.yaml (python style) and more
Hi, As a followup to the article i posted earlier ( https://log-it.tech/2019/03/15/get-the-info-you-need-from-consumer-group-python-style/ ) , you can use that info to put in into kafka_consumer.yaml for Datadog integration. It’s not elegant by any means, but it works. As an advise, please don’t over complicate thinks more than they need. In the last example i figured i…
-
Get the info you need from consumer group (python style)
Hi, For some of you might be of help. If it’s rubbish, i truly apologize, please leave a comment with improvements 🙂 I will not explain it. It should be self explanatory. Cheers
-
Kafka consumer group info retrieval using Python
Hi, I’ve been playing with kafka-python module to grab the info i need in order to reconfigure Datadog integration. Unfortunately, there is a catch also on this method. And i will show you below. Here is a little bit of not so elegant code. As you will see, print(meta[3]) will return a very ugly binary…
-
Python for opening and reading files
Since I started learning Python and hopefully take also a certification, I am trying to do some hands-on. Nothing too complicated, just some basic exercises, for the moment. Here is one of them. They want to though you to open the and file and read from it like: But there is a thing not to…