-
Notifications
You must be signed in to change notification settings - Fork 5
AzureApplicationInsights 패키지로 변경 & iframe 성능 개선 #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <meta name="description" content="Docker 공식 문서의 한국어 번역 프로젝트. 컨테이너(Container)와 이미지(Image) 개념, 설치 방법, 실습 튜토리얼, CLI, Compose, Swarm 등 DevOps와 개발자를 위한 최신 Docker 가이드와 베스트 프랙티스, 실전 예제, 문제 해결, 오픈소스 커뮤니티 정보까지 모두 제공합니다. 초보자와 전문가 모두를 위한 학습 자료와 FAQ 수록." /> | ||
| <script type="text/javascript" async> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azure application insights sdk를 npm 패키지로 사용하려고 script 태그 제거했습니다(변경하고 애저에서 트래픽 잡히는거 확인했음)
| src="https://www.youtube.com/embed/chiiGLlYRlY" | ||
| frameborder="0" | ||
| src="https://www.youtube.com/embed/chiiGLlYRlY?rel=0&modestbranding=1&playsinline=1" | ||
| allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" | ||
| allowfullscreen | ||
| loading="lazy" | ||
| title="Build, tag, and push an image" | ||
| referrerpolicy="strict-origin-when-cross-origin" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
나머지 docs/ 경로의 md 파일 또한 동일한 변경 내용입니다 :
src: 유튜브 비디오 관련 기능 최소화 -> 성능 개선frameborder: 이건 CSS 파일에서 다루도록 분리loading: lazy loading을 이용해 먼저 문서가 렌더링되고 처리되도록 수정referrerpolicy: 이건 유튜브에 넘어가는 정보를 최소화 -> 성능 개선 & 보안 강화 목적
| import { ApplicationInsights } from '@microsoft/applicationinsights-web'; | ||
|
|
||
| // Application Insights 초기화 | ||
| const appInsights = new ApplicationInsights({ | ||
| config: { | ||
| connectionString: | ||
| 'InstrumentationKey=7bea0293-01dc-409c-9471-3a65567b11ed;IngestionEndpoint=https://koreacentral-0.in.applicationinsights.azure.com/;LiveEndpoint=https://koreacentral.livediagnostics.monitor.azure.com/;ApplicationId=ddbe985c-4d7a-41e4-80a8-a3961068933b', | ||
| enableAutoRouteTracking: true, // SPA 라우팅 자동 추적 | ||
| enableCorsCorrelation: true, | ||
| enableRequestHeaderTracking: true, | ||
| enableResponseHeaderTracking: false, // 서버 응답 헤더 수집 불필요 | ||
| enableAjaxErrorStatusText: true, | ||
| enableAjaxPerfTracking: true, | ||
| enableUnhandledPromiseRejectionTracking: true, | ||
| disableAjaxTracking: false, | ||
| disableFetchTracking: false, | ||
| loggingLevelConsole: 0, // 콘솔 로깅 비활성화 | ||
| loggingLevelTelemetry: 1, | ||
| maxBatchSizeInBytes: 10000, | ||
| maxBatchInterval: 15000, | ||
| disableDataLossAnalysis: true, | ||
| disableCorrelationHeaders: false, | ||
| distributedTracingMode: 0, // 단일 서비스이므로 분산 추적 비활성화 | ||
| enablePerfMgr: false, | ||
| }, | ||
| }); | ||
| appInsights.loadAppInsights(); | ||
| appInsights.trackPageView(); // Manually call trackPageView to establish the current user/session/pageview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azure application for js npm 패키지를 사용하기 위한 코드
| @layer base { | ||
| /* 한국어 텍스트에 최적화된 시스템 폰트 스택 */ | ||
| html { | ||
| font-family: | ||
| -apple-system, | ||
| BlinkMacSystemFont, | ||
| 'Apple SD Gothic Neo', | ||
| 'Noto Sans KR', | ||
| 'Malgun Gothic', | ||
| '맑은 고딕', | ||
| 'Segoe UI', | ||
| Roboto, | ||
| 'Helvetica Neue', | ||
| Arial, | ||
| sans-serif; | ||
| } | ||
|
|
||
| /* 외부 웹폰트 최적화 (Google Fonts 등) */ | ||
| @font-face { | ||
| font-family: 'Google Fonts Fallback'; | ||
| src: local('system-ui'), local('-apple-system'); | ||
| font-display: swap; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본 폰트 설정, 외부 웹폰트 최적화
| /* YouTube iframe 최적화 */ | ||
| @layer components { | ||
| .youtube-video { | ||
| @apply relative w-full mx-auto; | ||
| aspect-ratio: 16 / 9; /* 모던 브라우저용 */ | ||
| /* 레거시 브라우저 대체 */ | ||
| padding-bottom: 56.25%; /* 16:9 종횡비 */ | ||
| } | ||
|
|
||
| /* 모던 브라우저에서 padding-bottom 제거 */ | ||
| @supports (aspect-ratio: 16 / 9) { | ||
| .youtube-video { | ||
| padding-bottom: 0; | ||
| } | ||
| } | ||
|
|
||
| .youtube-video iframe { | ||
| @apply absolute top-0 left-0 w-full h-full rounded-lg; | ||
| border: none; /* frameborder 대체 */ | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iframe 관련 태그에서 스타일 관련 내용은 속성으로 안 넣고 CSS 파일에서 처리하게끔 분리
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request replaces the legacy Application Insights snippet with the Azure Application Insights package and optimizes YouTube iframe performance. Key changes include:
- Integrating Application Insights in main.ts via the @microsoft/applicationinsights-web package.
- Updating YouTube embeds in various markdown files to use the youtube-nocookie endpoint with lazy loading and improved accessibility attributes.
- Removing the redundant legacy Application Insights snippet from index.html.
Reviewed Changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/styles/style.css | Adds base styling and component styles for YouTube iframes. |
| src/scripts/main.ts | Introduces and configures the new Application Insights client. |
| public/docs/**/*.md | Updates YouTube embed URLs and attributes for performance and accessibility. |
| package.json | Adds the @microsoft/applicationinsights-web dependency. |
| index.html | Removes the legacy Application Insights snippet. |
Comments suppressed due to low confidence (1)
index.html:8
- Ensure that removing the legacy Application Insights snippet from index.html doesn't affect any dependencies expecting a global appInsights instance.
<script type="module" src="./src/scripts/main.ts" defer></script>
| connectionString: | ||
| 'InstrumentationKey=7bea0293-01dc-409c-9471-3a65567b11ed;IngestionEndpoint=https://koreacentral-0.in.applicationinsights.azure.com/;LiveEndpoint=https://koreacentral.livediagnostics.monitor.azure.com/;ApplicationId=ddbe985c-4d7a-41e4-80a8-a3961068933b', |
Copilot
AI
Jun 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider moving the Application Insights connection string to environment variables or a secure configuration file to avoid exposing sensitive information in the source code.
| connectionString: | |
| 'InstrumentationKey=7bea0293-01dc-409c-9471-3a65567b11ed;IngestionEndpoint=https://koreacentral-0.in.applicationinsights.azure.com/;LiveEndpoint=https://koreacentral.livediagnostics.monitor.azure.com/;ApplicationId=ddbe985c-4d7a-41e4-80a8-a3961068933b', | |
| connectionString: process.env.APPINSIGHTS_CONNECTION_STRING || '', | |
| // Ensure the environment variable is set in the deployment environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이건 공식문서에도 오픈되어도 상관없다는 내용이 있기 때문에 무시해도 됩니다
YoonKeumJae
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
작성 내용
댓글 참고
참고자료
close #154