Guide on Exporting Opentelemetry Traces to GCP
In this post, I want to share how to export the traces generated by your FastAPI application to the GCP observability platform.
Recent content on jdhao's digital space
In this post, I want to share how to export the traces generated by your FastAPI application to the GCP observability platform.
With OpenTelemetry , you can easily trace a single request across multiple services in a distributed system. In this post, I would like to share how you can set up OpenTelemetry tracing for your FastAPI application.
Recently, I was working on migrating our Elasticsearch cluster to serverless . We have an index where some field stores dense vectors used in KNN search.
In Elasticsearch, when you index document to an index, if you do not specify the mapping for the field, Elastic will use dynamic mapping to infer the data type for your field.
In our work, we are using renovate to update the dependency packages for Python projects. Previously when we are using good old pip and requirements.txt for package management, renovate works fine since it only needs to update the package version in requirements.txt . We switch to uv this year as our project management tool. Since uv uses pyproject.toml and uv.lock (lockfile) to ensure…
To make python plugins work in Neovim, we need to set up the python provider properly. Usually, this means setting up the correct path to Python executable and also installing the pynvim – Neovim client for Python.
Notes about how to use ripgrep to search hidden files and configuration related to Neovim.
We have a Python project where there are several developers, and we have a mature CI pipeline to do code linting, formatting check for python, yaml, json, and testing etc. The problem with CI pipeline is that you can only get feedback after you commit your code and push to the remote repo. The feedback is not instant and may be delayed for several minutes. If there are some linting issues, you…
A major Neovim release (version 0.12) has been released a few days ago, after more than one year from the last major release (version 0.11). The following is a list of feature I am interested. For a complete set of features, check full changelog and news . builtin package manager vim.pack # Now you can use the builtin vim.pack API to manage your plugins. Check this detailed post if you want to…
When unit-testing a function that make multiple external calls/requests, we want to mock the actual call and return the mock results. For each call, we might want to return different results.
Previously, our projects are still using the old Python 3.10, which will be deprecated soon this year . We are also using the good old pip and venv for the project/package management. This is already posing some issues for us: venv is a pure virtual env tool without the ability to manage python versions (it just picks your local python), so it is hard to enforce the local env of each developer…
In python projects, we always need a linter to catch potential issues and enforce best practices. In the past, there were linters like pylint, flake8. However, they are not performant for large code bases and also you have to install different tools for linting. Then ruff came out in 2022 and completely changed the Python linter landscape. It can literally replace all the other major linters with…
When I am working on a Python project, I am using black to format the code, so that we have a unified format across the code base. One pain point, however, is the super annoying trailing white spaces: black can remove trailing spaces for doc string, code and comment, but it will not touch trailing spaces in, e.g., multi-line strings.
In this post, I compare the object vs nested type used in data mapping in Elasticsearch.
When you do code testing using pytest, pytest can do sophisticated changes to your logging. This is a very powerful feature, but carries some subtlety.
In Elasticsearch, when we index documents to an index, by default the source of the document is stored in meta field _source . When you search your index, you see a special field _source for each matched/hit product.
本文总结如何制作中式家常版本的“葱花饼”。
今天总结一下在德国超市里常见的蔬菜苤(piě)蓝(德语叫 kohlrabi ,在中国东北叫“卜留克”) 凉拌的做法。
和众多网友一样,我也有高考 PTSD 。
Recently I was trying to sync my hiking course from Garmin connect to my Garmin Forerunner 965 and found that it does not work.
In Elasticsearch, you can use wildcard in a lot of the index operations. This is very handy, but can be dangerous sometimes, e.g., when you use wildcards when deleting indexes. You may delete unintended indexes accidentally and cause serious interruptions to your business/work.
This post will give a quick summary on how to import GPX route into Garmin watch.
When I try to run pytest locally for a Python project, I noticed that the import in those test scripts may fail if I run pytest in different directories. The import error usually means that your actual code modules is not in the python path, so they can not be imported successfully by your test scripts. This has something to do with how pytest set up the python path when you run it.
本次来复刻泰国非常受欢迎的打抛饭。
本文总结如何用烤箱烤羊肉串。
When we are using 3rd packages in Python, we may see some warning messages. For example, when you use the package BeautifulSoup and provide it with an url:
这次来总结一下烤箱烤鸡腿的做法。
In this post, I would like to compare several speakers that are relatively small in size and are suitable as desktop speakers.
Although neovim has built a lot of modules to ease the use of Lua, sometimes we may still want to use packages from LuaRocks . In this post, I would like to share how you can install a package from LuaRocks and use it in nvim.
最近趁着黑五入手了外接显示器,顺便了解了一下显示器相关的各种标准和技术,本文做一个总结。
寒冷的冬天,和羊肉汤更配。
When using APScheduler package in Python, I want to run the scheduled job right after I start the scheduler. How can I do it properly?
When we use one of the google cloud python clients to communicate with GCP, there may be errors occurring sometime calling the client API methods.
今天来总结一下土豆金枪鱼沙拉的做法。
本次来总结一下椰汁咖喱鸡的做法。
本次来总结凉拌绿豆宽粉的做法。
When deploying a Python application to GCP Kuberntes Engine, we may see issues that the logging level is not correct in the cloud logging explorer. In order for the Python logging package to work with GCP, we need some additional configurations.
本次来复刻一下在网上看到的西班牙土豆饼。
The version conflict error is often seen when doing document indexing operations in Elasticsearch.
In Elasticsearch (ES), you can run a task and check its status with the task API . For example, if you use the reindex API in ES with parameter with_for_completion=False , ES will not wait for the process to finish and will return a task instead.
In Elasticsearch, there is index API where you can index a single document to an index.
Recently when I was working with Elasticsearch, I found this weird issue that the document count for the newly created index is not correct. Also there are problems with reindex, if you reindex the source index to destination index, there is nothing in the destination index despite no errors.
Some notes on using the Google Cloud storage .
在德国的德超很少能见到羊肉,不过在土耳其超市可以很方便买到羊肉。 本期我来做一个煎羊排,之所以不是因为烤羊排是因为我没有合适的烤盘和锡箔纸,所以没有尝试。